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


Groups > comp.lang.python > #37723

Re: Cancel threads after timeout

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jsf80238@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'python,': 0.02; 'answering': 0.09; 'cc:addr:python-list': 0.10; 'thread': 0.11; 'portion': 0.13; '"cancel"': 0.16; 'subject:threads': 0.16; 'trying': 0.21; 'assuming': 0.22; 'recognize': 0.22; 'cc:2**0': 0.23; 'minutes.': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'that.': 0.30; 'query': 0.30; 'figure': 0.30; 'quickly': 0.32; 'cancel': 0.33; 'received:google.com': 0.34; 'server': 0.35; 'expected': 0.35; 'sometimes': 0.35; 'received:209.85': 0.35; 'generation': 0.36; 'possible': 0.37; 'execute': 0.37; 'itself': 0.37; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'received:209.85.214': 0.39; 'takes': 0.39; 'your': 0.60; 'respect': 0.63
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=tYv1TMbHXdmLAJ0s/5TrQPOvsX1BuTO4Y6v4cZ4o5Pg=; b=wIgRfSAvPYqJmNs612KdeEshW4JKvJaysaIxeP+P1mRGKpGFIojc4MFp15nTlVTpaG s0efdiOWl5TRrOdnoKDlqfi2Sa1lsuLr185BTBZYdLljCjW9kDL7nsSPae1f/1kyaq3b oofr+azDDV2dmSwn4LMmA8YJ/1WXOVJsSRph9ajWM5WJKI/+CelbCgVMqoyobrXR3u8S 5pLN7VK7oGoGaowpKYsq8Cz+wFtPQyJPB1P6Rgt/iuTQqEqvt1VVbVX3GvfDVT1QzSGq iuAyIRGiDrYs4YctWaMdUG2N5HJ5D7hCkI+KI2TcQnNGOnmsdz2lbXFdQDXsIYlUmPwO PavA==
MIME-Version 1.0
X-Received by 10.205.124.146 with SMTP id go18mr2701280bkc.68.1359215006806; Sat, 26 Jan 2013 07:43:26 -0800 (PST)
In-Reply-To <20130126131408.GA6300@sagitarius.getae.net>
References <20130126131408.GA6300@sagitarius.getae.net>
Date Sat, 26 Jan 2013 08:43:26 -0700
Subject Re: Cancel threads after timeout
From Jason Friedman <jsf80238@gmail.com>
To hyperboreean <hyperboreean@nerdshack.com>
Content-Type text/plain; charset=UTF-8
Cc 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.1080.1359215014.2939.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1359215014 news.xs4all.nl 6954 [2001:888:2000:d::a6]:48495
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:37723

Show key headers only | View raw


> Sometimes it happens that a query on one of the database servers
> takes longer than expected and impedes the generation of this report
> (that's right, the queries are ran sequential). What I am trying to
> achieve is to parallelize the queries on each database server and to be
> able to cancel one of them if it takes longer than X minutes.

Only answering a small portion of your question ....
Assuming you are able to figure out how to "cancel" a thread or
process on your side, it is possible the database itself will not
respect that.  In other words, if you execute "SELECT ..." singly,
outside of Python, and type CNTL-C, does your database quickly
recognize you are no longer interested in the result set and stop its
work?

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


Thread

Re: Cancel threads after timeout Jason Friedman <jsf80238@gmail.com> - 2013-01-26 08:43 -0700

csiph-web