New submission from Paul Moore <p.f.mo...@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) messages: 154549 nosy: pmoore priority: normal severity: normal status: open title: Option to kill "stuck" workers in a multiprocessing pool type: enhancement versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14148> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com