don't ask for exception is Future is not done

This commit is contained in:
Min RK
2018-04-09 14:47:50 +02:00
parent 955b769d3f
commit e962c9993b

View File

@@ -555,7 +555,10 @@ class User:
except Exception:
self.log.exception("Error in Authenticator.post_spawn_stop for %s", self)
spawner._stop_pending = False
if not (spawner._spawn_future and spawner._spawn_future.exception()):
if not (
spawner._spawn_future and
(not spawner._spawn_future.done() or spawner._spawn_future.exception())
):
# pop Spawner *unless* it's stopping due to an error
# because some pages serve latest-spawn error messages
self.spawners.pop(server_name)