-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel shutdown on page refresh #55
Comments
Ran into the same thing today; Especially when hitting reload for ~10 repeatedly, this indeed results in 10x new kernels spinning up.
The reason why the kernels arent shutting down due to: While its too easy to spin up / forkbomb the server, at least processes do get reap'd when the following options are thrown in the mix: self.kernel_manager = MappingKernelManager(
cull_busy=False,
cull_connected=False,
cull_idle_timeout=6,
kernel_info_timeout=12,
... ( PR follows shortly ) I noticed @maartenbreddels is working on a SPA PR, ( cool btw 🍹 ) perhaps an idea is to throttle refreshing the SPA page. In that line of thought, perhaps controlling how the page refreshes is relevant ( see here ). For example, a timedelta of 1 second -or 5- would be required before refreshing the page.
interesting find... |
@jf--- Looked at it earlier today with the intent of switching from using voila as a server extension to the standalone app. As a server extension the kernel culling can be set via the notebook config.
I opened #80, but feel free to comment or add anything missing against this PR. |
hi @jtpio , so the PR misses out on a few things I think: First, the cull_busy=False,
cull_connected=True, Furthermore, I do think that healthy defaults need to be set for cull_idle_timeout=6,
kernel_info_timeout=12, As the PR is as of now, the issue effectively isn't resolved, since the defaults yields the same program state as pre-PR... That said, IMO there's quite a difference of running Therefore since it is currently straightfwd to forkbomb a server, I think the defaults should ackowledge this. |
Regarding the defaults, it depends on how the dashboards are being used. In some cases enabling Overall this will become easier to manage when the voila standalone app supports the traitlets configuration system (cf #84). |
Coming back to the original issue, I do see that kernel shutdown is being triggered on page refresh with chrome, or with navigation away from a page. It does not trigger it when closing a tab. I think we can tackle this once we have a better idea on session/kernel reuse etc. |
Fixed in #147 |
@maartenbreddels , would you mind commenting briefly on how the changes in #147 wedge into resolving this issue? I'm curious since on the surface the PR doesn't deal with aspects of session/kernel reuse |
How do I prevernt shutdown and restart ? |
see #527 |
Looks like kernels are not shut down when refreshing the page (using the standalone app):
Seems to be related to how the
beforeunload
event is triggered:https://github.com/QuantStack/voila/blob/c437a7fc564aee20e76526fa3c9acc5a5fef326f/voila/static/main.js#L12-L14
The text was updated successfully, but these errors were encountered: