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


Groups > comp.lang.python > #37752

Re: Cancel threads after timeout

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!nuzba.szn.dk!pnx.dk!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'abort': 0.09; 'compute': 0.09; 'pause': 0.09; 'cc:addr:python-list': 0.10; 'result.': 0.15; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'investigate': 0.16; 'message- id:@cskk.homeip.net': 0.16; 'query.': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:edu.au': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'simpson': 0.16; 'subject:threads': 0.16; 'wrote:': 0.17; 'pieces': 0.17; 'solution.': 0.18; 'proposed': 0.20; 'cheers,': 0.23; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'run': 0.28; 'query': 0.30; 'running': 0.32; 'problem': 0.33; '(with': 0.33; 'another': 0.33; 'but': 0.36; 'received:au': 0.36; 'charset:us- ascii': 0.36; 'itself': 0.37; 'does': 0.37; 'option': 0.37; 'subject:: ': 0.38; 'your': 0.60; 'content-disposition:inline': 0.60; 'real': 0.61; 'spending': 0.61; 'latest': 0.61; 'between': 0.63; 'fun': 0.64; 'limit': 0.65; 'regularly': 0.65; 'life': 0.66; 'sounds': 0.71; 'snapshot': 0.84; 'snapshots': 0.84
Date Sun, 27 Jan 2013 11:34:13 +1100
From Cameron Simpson <cs@zip.com.au>
To Matt Jones <matt.walker.jones@gmail.com>
Subject Re: Cancel threads after timeout
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <CANuMAv_Bf3_B6OEaOFgkVoWegMJH1eihTDtu0hUvVkMUFQo8YQ@mail.gmail.com>
User-Agent Mutt/1.5.21 (2010-09-15)
References <CANuMAv_Bf3_B6OEaOFgkVoWegMJH1eihTDtu0hUvVkMUFQo8YQ@mail.gmail.com>
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1099.1359247178.2939.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1359247178 news.xs4all.nl 6923 [2001:888:2000:d::a6]:53333
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37752

Show key headers only | View raw


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.

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

Do not taunt Happy Fun Coder.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Cancel threads after timeout Cameron Simpson <cs@zip.com.au> - 2013-01-27 11:34 +1100

csiph-web