Log failure to shutdown workers in pool cleanly

This commit is contained in:
Kovid Goyal 2015-06-03 18:41:27 +05:30
parent 73caed9c54
commit 35dec94173
2 changed files with 3 additions and 0 deletions

View File

@ -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): # {{{

View File

@ -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))