Skip to content

Commit

Permalink
init_httpserver at the end of initialize
Browse files Browse the repository at this point in the history
init_httpserver references IOLoop.current()

If a server extension sets an asyncio EventLoopPolicy, any prior reference to IOLoop.current or asyncio.get_event_loop() will be invalidated.

We should try to avoid this during intialize at all, or at least until the very end.

Arguably, the http server listen should occur in `.start()`
minrk committed May 13, 2021
1 parent f5b3b2d commit 9cf60d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
@@ -1864,13 +1864,13 @@ def initialize(self, argv=None, find_extensions=True, new_httpserver=True, start
self.init_configurables()
self.init_components()
self.init_webapp()
if new_httpserver:
self.init_httpserver()
self.init_terminals()
self.init_signal()
self.load_server_extensions()
self.init_mime_overrides()
self.init_shutdown_no_activity()
if new_httpserver:
self.init_httpserver()

def cleanup_kernels(self):
"""Shutdown all kernels.

0 comments on commit 9cf60d9

Please sign in to comment.