Log the exception raised in Spawner.post_stop_hook instead of raising it

This commit is contained in:
Jia Junjie
2021-04-13 08:01:59 +00:00
parent 19c3b02155
commit 786c7039d6

View File

@@ -826,10 +826,7 @@ class User:
try:
await maybe_future(spawner.run_post_stop_hook())
except:
spawner.clear_state()
spawner.orm_spawner.state = spawner.get_state()
self.db.commit()
raise
self.log.exception("Error in Spawner.post_stop_hook for %s", self)
spawner.clear_state()
spawner.orm_spawner.state = spawner.get_state()
self.db.commit()