Closed rebornix closed 1 week ago
@rebornix Are you looking for some API support here? Do you have an idea how to veto here?
@sandy081 it's the most accurate if it can be controlled by extensions (since only kernel extensions know if the kernel is stateful or not), but I think maybe we can start having an veto hook/api internally in renderer process, and the notebook component can veto whenever there is a notebook open and kernel selected. How does this sound to you?
We already have such an event in the workbench for the components to listen to and react
@sandy081 would you ever consider having an extension api, with which extensions can declare if they have intermediate state that can't be restored if EH restarts? Vetoing from the core can be a good start, but in practice only kernel extensions know if it should veto the restart. For example, GitHub Issue Notebook's kernel is stateless so it doesn't need to block the start. Jupyter should block if users are using a local kernel, but it should not if users are using remote kernels (as it knows how to auto reconnect).
Asking for a more granular control since if we veto if there is a kernel selected, it might mean a good amount of data science users will never get "auto restart" since their main editor is notebook.
would you ever consider having an extension api,
Actually we are trying to avoid that. But if it is needed, we can definitely work on it. It seems to be a problem not just during auto restart of extensions, but also when user restart extensions manually which can happen on profile switch / workspace trust / updating extensions.
Asking for a more granular control since if we veto if there is a kernel selected, it might mean a good amount of data science users will never get "auto restart" since their main editor is notebook.
Seems to make sense to me.
but I think maybe we can start having an veto hook/api internally in renderer process, and the notebook component can veto whenever there is a notebook open and kernel selected. How does this sound to you?
@rebornix Lets start with a veto when there is an open notebook. Should I go ahead and adopt the existing API in notebook land?
@rebornix I adopted notebooks for auto restarting of extension host - https://github.com/microsoft/vscode/pull/224178
Please take a look.
This disallow auto restarting of extension host when there is an open notebook editor.
I am planning to add similar fix for custom/webview editors.
Closing this and will open separate issue for custom editors
To verify:
extensions.autoRestart
@rebornix Can you please verify this.
Step 5 fails. I'm uninstalling the Pull Requests extension for Step 3, and have a .ipynb notebook open for Step 2.
Does this issue occur when all extensions are disabled?: Yes/No
We might want to veto extension host auto restart when users are using a notebook kernel. Auto restarting will lead to data loss.