Understanding sessions #1005
Replies: 1 comment 1 reply
-
This sounds more like a question for the Lab folks. When the Lab (or Notebook) server is configured to use EG, the server essentially redirects kernel management and websocket requests to the EG server running in a headless mode. The sessions used (and I believe those you see leaked) are in the lab/notebook server since EG doesn't use these sessions (EG has a kernel session object for managing state for HA/DR purposes, but that is different). I'm not intimately familiar with how the frontends manage kernels but can try to provide what I know relative to your questions.
A session is created per notebook since it's via the session that kernels are initiated.
This is because shutdown of the notebook is supposed to stop the kernel and the notebook server is just relaying that kernel management aspect of things to EG.
Yes. The same goes for lab. You can change a kernel of an existing notebook to another, currently running, kernel. EG is merely a "kernel as a service" model - so hitting the appropriate endpoint with the appropriate kernel_id will access the same kernel.
For EG, kernels are started via a POST to /api/kernels, whereas the front-end issues a POST to /api/sessions. That latter case, under the covers when EG is configured, then issues the POST to /api/kernels. |
Beta Was this translation helpful? Give feedback.
-
We are using jupyterlab with enterprise gateway. The way we render jupyter notebook is in an iframe, by constructing the url for the ipynb file we want to show, for eg, something like https:///lab/tree/. This worked fine, however what we saw that bunch of jupyter sessions kept lingering around even though we moved away from the page. Probably, we were not doing Close and Shutdown kind of close on the files opened in that iframe. Eventually, the issue we hit was after few of these sessions were present, going to a file foo.ipynb landed up on file bar.ipynb. I havent fully understand how that could happen, but at this point, i wanted to understand sessions.
Thanks for the help. @kevin-bates
Beta Was this translation helpful? Give feedback.
All reactions