[TurboGears] Stopping a runaway request in TG 1...

6 views
Skip to first unread message

Sam

unread,
Apr 22, 2010, 11:17:04 PM4/22/10
to TurboGears
In the administrative back end for 1000 Corks our admins can do some
complicated pattern matching. Occasionally a pattern match will be so
inefficient it seems to more or less bring cherrypy to its knees for
minutes at a time.

I'd like to have some way of timing these requests out and returning
an appropriate message.

Can I do this?

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

Diez B. Roggisch

unread,
Apr 23, 2010, 3:22:04 AM4/23/10
to turbo...@googlegroups.com
General wisdom on this is: delegate this task to a suborocess
(preferrably via the new multiprocessing module, or pyro), and
terminate that if it didn't return after x seconds.

You can also use ctypes to expose thread killing functions from your
OS, but that's a slippery road better not to walk down.

Diez

Am 23.04.201 um 05:17 schrieb Sam <sams...@gmail.com>:

Sam

unread,
Apr 23, 2010, 5:18:41 PM4/23/10
to TurboGears
Diez...

Sounds like a great idea. I'll give multiprocessing a try. I've used
it before, just never in conjunction with TurboGears.

Thanks
Sam

On Apr 23, 12:22 am, "Diez B. Roggisch" <de...@web.de> wrote:
> General wisdom on this is: delegate this task to a suborocess  
> (preferrably via the new multiprocessing module, or pyro), and  
> terminate that if it didn't return after x seconds.
>
> You can also use ctypes to expose thread killing functions from your  
> OS, but that's a slippery road better not to walk down.
>
> Diez
>
> Am 23.04.201 um 05:17 schrieb Sam <samsli...@gmail.com>:
>
>
>
>
>
> > In the administrative back end for 1000 Corks our admins can do some
> > complicated pattern matching.  Occasionally a pattern match will be so
> > inefficient it seems to more or less bring cherrypy to its knees for
> > minutes at a time.
>
> > I'd like to have some way of timing these requests out and returning
> > an appropriate message.
>
> > Can I do this?
>
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "TurboGears" group.
> > To post to this group, send email to turbo...@googlegroups.com.
> > To unsubscribe from this group, send email to turbogears+...@googlegroups.com
> > .
> > For more options, visit this group athttp://groups.google.com/group/turbogears?hl=en
Reply all
Reply to author
Forward
0 new messages