Skip to content

Commit

Permalink
Fix to add session only after kernel validation (#6251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwajeet0510 authored Jan 25, 2022
1 parent 52581f8 commit 479902d
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 @@ -371,7 +371,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().open()
Expand Down

0 comments on commit 479902d

Please sign in to comment.