mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-02 13:23:03 +02:00
Log failure to shutdown workers in pool cleanly
This commit is contained in:
parent
73caed9c54
commit
35dec94173
2 changed files with 3 additions and 0 deletions
|
|
@ -566,6 +566,8 @@ def shutdown(self):
|
|||
wait_till = time.time() + self.opts.shutdown_timeout
|
||||
for pool in (self.plugin_pool, self.pool):
|
||||
pool.stop(wait_till)
|
||||
if pool.workers:
|
||||
self.log.warn('Failed to shutdown %d workers in %s cleanly' % (len(pool.workers), pool.__class__.__name__))
|
||||
|
||||
class EchoLine(Connection): # {{{
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ def test_workers(self):
|
|||
with self.assertRaises(socket.timeout):
|
||||
conn.getresponse()
|
||||
self.ae(pool.busy, 1)
|
||||
server.loop.log.filter_level = server.loop.log.ERROR
|
||||
server.loop.stop()
|
||||
server.join()
|
||||
self.ae(1, sum(int(w.is_alive()) for w in pool.workers))
|
||||
|
|
|
|||
Loading…
Reference in a new issue