[New-bugs-announce] [issue14148] Option to kill "stuck" workers in a multiprocessing pool
report at bugs.python.org
Tue Feb 28 12:43:00 CET 2012
New submission from Paul Moore <p.f.moore at gmail.com>:
I have an application which fires off a number of database connections via a multiprocessing pool. Unfortunately, the database software occasionally gets "stuck" and a connection request hangs indefinitely. This locks up the whole process doing the connection, and cannot be interrupted except by killing the process.
It would be useful to have a facility to restart "stuck" workers in this case.
As an interface, I would suggest an additional argument to the AsyncResult.get method, kill_on_timeout. If this argument is true, and the get times out, the worker servicing the result will be killed and restarted.
Alternatively, provide a method on an AsyncResult to access the worker process that is servicing the request. I could then wait on the result and kill the worker manually if it does not respond in time.
Without a facility like this, there is a potential for the pool to get starved of workers if multiple connections hang.
components: Library (Lib)
title: Option to kill "stuck" workers in a multiprocessing pool
versions: Python 3.3, Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce