mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Log failure to shutdown workers in pool cleanly
This commit is contained in:
parent
73caed9c54
commit
35dec94173
@ -566,6 +566,8 @@ class ServerLoop(object):
|
||||
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 @@ class LoopTest(BaseTest):
|
||||
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…
x
Reference in New Issue
Block a user