[repository] fire 'server_shutdown' hooks before waiting for theads
This is required for threaded tasks that use the 'server_shutdown' hook to die properly,
as for example the ZMQ server in an all-in-one configuration
--- a/server/repository.py Wed Apr 04 16:51:09 2012 +0200
+++ b/server/repository.py Tue Apr 10 17:07:03 2012 +0200
@@ -429,13 +429,13 @@
self.system_source.shutdown()
if self._tasks_manager is not None:
self._tasks_manager.stop()
+ if not (self.config.creating or self.config.repairing
+ or self.config.quick_start):
+ self.hm.call_hooks('server_shutdown', repo=self)
for thread in self._running_threads:
self.info('waiting thread %s...', thread.getName())
thread.join()
self.info('thread %s finished', thread.getName())
- if not (self.config.creating or self.config.repairing
- or self.config.quick_start):
- self.hm.call_hooks('server_shutdown', repo=self)
self.close_sessions()
while not self._cnxsets_pool.empty():
cnxset = self._cnxsets_pool.get_nowait()