Skip to content

Commit

Permalink
Fix to add session only after kernel validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwajeet0510 committed Jan 12, 2022
1 parent 85f1b9f commit 30732b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion notebook/services/kernels/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def _register_session(self):
if stale_handler:
self.log.warning("Replacing stale connection: %s", self.session_key)
yield stale_handler.close()
self._open_sessions[self.session_key] = self
if self.kernel_id in self.kernel_manager: # only update open sessions if kernel is actively managed
self._open_sessions[self.session_key] = self

def open(self, kernel_id):
super(ZMQChannelsHandler, self).open()
Expand Down

0 comments on commit 30732b2

Please sign in to comment.