Skip to content

Commit

Permalink
Force comm reconnect when comm is closed (e.g. kernel restarts, etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
halleysfifthinc committed Nov 27, 2024
1 parent 6e1ce92 commit 00d0420
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,17 @@ class WebIONotebookManager {
) {
// Stop attempting to handle callbacks if previous kernel is gone
this._webIO.setSendCallback((msg: any) => {});

// Close comm to force a re-connect to the new/restarted kernel
this.comm!.close();
}
},
this,
);
this.comm.onClose = (msg: any) => {
// Undefine comm so that the next connect call creates a new comm
this.comm = undefined;
};

this.setWebIOMetadata(kernel.id, this.comm.commId);
}
Expand Down

0 comments on commit 00d0420

Please sign in to comment.