Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37794 > unrolled thread

Re: Cancel threads after timeout

Started byJason Friedman <jsf80238@gmail.com>
First post2013-01-27 21:57 -0700
Last post2013-01-27 21:57 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Cancel threads after timeout Jason Friedman <jsf80238@gmail.com> - 2013-01-27 21:57 -0700

#37794 — Re: Cancel threads after timeout

FromJason Friedman <jsf80238@gmail.com>
Date2013-01-27 21:57 -0700
SubjectRe: Cancel threads after timeout
Message-ID<mailman.1123.1359349042.2939.python-list@python.org>
> On 26Jan2013 09:48, Matt Jones <matt.walker.jones@gmail.com> wrote:
> | It sounds like your real problem is with your SQL query...  Is that part of
> | this problem under your control?  Can you break the query into smaller,
> | quicker, pieces that you can run in a reasonable amount of time?
>
> Another option to investigate is whether you can ask the database itself
> to limit the run time of a query. Of course, that will abort the query
> but so does your proposed solution.
>
> Another approach might be to simply run each query regularly (with a
> pause between so the database is not spending its whole life running
> your query). Snapshot each latest result. Compute your report from the
> latest pair of snapshots at any given time on an independent schedule.
> It may not be valid for what you need, but if it is then this decouples
> you from the query time completely.

Along these lines, if you are running on Linux then the bash shell
comes with a "timeout" command, which you can prepend to snapshot
requests.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web