-
Notifications
You must be signed in to change notification settings - Fork 283
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 Proposal #618
Comments
hi @mlucool, this makes sense to me - thanks for raising it. I have some questions, comments...
Another approach would be to unconditionally issue an ((I'm hoping we could drop the |
I like this idea. Still, it seems like SIGTERM is needed for things inside the kernel to be able to cleanly shutdown. New proposal:
I don't have a good intuition as to how long we need to wait between the steps. Is the 60/40 idea to wait 3 seconds after the control channel and 2 seconds after SIGTERM? cc @Carreau - what do you think w.r.t. ipykernel? |
Assuming the interrupt request would proceed today's graceful shutdown sequence and restore the kernel's ability to respond to control messages, I would argue that the request-shutdown message is tantamount to issuing SIGTERM prior to SIGKILL and we don't need the additional SIGTERM.
Yes, but only if we don't perform the interrupt as a prerequisite to the request-shutdown message. I'm not familiar with kernel message handling in general, so would like to hear other opinions as well. |
I agree that sending interrupt before request_shutdown make sens. |
In case xeus authors have any thoughts here as well - cc @martinRenou @SylvainCorlay |
Hey @mlucool, thanks for the ping! FYI, I opened a PR to ipykernel last week to run the control channel in a separate thread, so that ipykernel can properly handle shutdown request while processing execute requests. We are also working on plugging the debugger on top of that PR. I think it makes sense for kernels to implement signal handlers, but I am not sure it is really necessary from a |
Based on above, I think it's still best to send SIGTERM in case some code is blocking the shutdown. What if we set the default to 7s and split the time between proposed steps 1&2 and 1&3 - so 3.5 for the control channel to shut down and 3.5 for graceful SIGTERM? |
I think this seems fine but would just like to clarify the sequencing. Here's my understanding...
Is that the plan? (Thanks for dealing with this.) |
Correct @kevin-bates. Only final question is should we increase the total |
I'm beginning to think it might be best to keep The help text for Does that sound reasonable? |
I think users care about the total max time they would have to wait to have the kernel be stopped ( |
ok - I'm fine with that. |
Great. @kevin-bates, in terms of implementing this change, are you planning to do it? If not, I'm happy to have someone on my end contribute it. |
I wasn't planning on implementing this; a contribution would be welcome. Thanks Marc. |
Shutdown kernel states the following in it's doc:
While this seems like the right thing to do, it does not work well for kernels like IPykernel (but may be fine for kernels like Xeus-Python). The problem is the signal sent via the control channel may be blocked by a running process, so there is no real chance to cleanly shut it down.
I propose that we add a step between 1 and 2 which tries SIGINT and then tries SIGTERM before finally using SIGKILL (step 2 today). What do you think?
The text was updated successfully, but these errors were encountered: