microsoft / vscode-tools-for-ai

Azure Machine Learning for Visual Studio Code, previously called Visual Studio Code Tools for AI, is an extension to easily build, train, and deploy machine learning models to the cloud or the edge with Azure Machine Learning service.
Other
323 stars 94 forks source link

VS Code notebook loses connection to running kernel over night. #1361

Open greazer opened 2 years ago

greazer commented 2 years ago

Expected Behavior

Connection to running notebook on an Azure ML compute remains even after many hours

Actual Behavior

Disconnect occurs at some point with a modal dialog stating "Cannot reconnect. Please reload the window". This is coming from VS Code core (or remote services).

Steps to Reproduce the Problem

  1. Create a notebook with a code cell like this:

image

  1. Let it run overnight. By morning you'll see something like this:

image

Per Rob on the VS Code team, this disconnection is expected. There may be ways of ensuring it doesn't happen via the Azure ML extension. This could be problematic for cost (though I'm not sure how it's different than running a kernel all night).

Barring the prevention of disconnect, VS Code core and the Jupyter extension team may need to develop a way to explicitly disconnect and reconnect to running kernels.

sevillal commented 2 years ago

Reconnection

Regarding the reconnection issue here is further explanation on the cause, the timestamps shown are just to depict an approximation of how events would happen:

To solve VS Code Server not running, we could install and start the server on each reconnection, but it won't resolve the reconnection because of the following:

Follow up with VS Code:

Solution