-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Description
I have my own custom Notebook.tsx
component that uses the Cell.tsx
set from jupyter-react
- a very similar version - with just a few enhancements - compared to what I documented in What is the best way to ensure the shutdown of a kernel before initializing a new one? #338.
Currently, every time a user accesses this notebook, we create a kernel, and upon exiting, we shut it down (to maintain a unique context per notebook, similar to the JupyterLabApp
).
One issue we have today (and would like to confirm) is that even after a user leaves Notebook X, meaning they are no longer inside the component and the associated kernel has been shut down, requests to /jupyter-server/api/sessions?{id}
and /jupyter-server/api/kernels?{id}
continue to be made continuously (and these likely accumulate as we have N notebooks with N cells).
From some tests, I noticed that this seems to occur even in the ./src/examples/Cells
of the library.
Is this a known issue, and is there any way to control these calls?
Reproduce
- Create a wrapper over
Cells.tsx
example; - Leave the component (navigate to another route/context) and observe the requests still being made.
Expected behavior
Have better control over these requests
Context
-
Datalayer version:
0.17.2
-
Browser and version:
Chrome Version 130.0.6723.116
-
Current unmount code:
notebookStore.reset(id).finally(() => {
kernelManager?.shutdown(kernel.id).then().finally(() => {
console.log(`Kernel ${kernel?.id} is turned off`);
});
});
- From our custom
Notebook.tsx
:
- From jupyter-react
./src/examples/Cells
: