Skip to content

Persistent API Calls After Cells Kernel Shutdown #343

@MarcosVn

Description

@MarcosVn

Description

I have my own custom Notebook.tsx component that uses the Cell.tsx set from jupyter-react

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

  1. Create a wrapper over Cells.tsx example;
  2. 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:

image

  • From jupyter-react ./src/examples/Cells:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions