When using the Wolfram kernel in Jupyter running inside the VS Code Jupyter extension on a Linux machine, the WolframKernel and WolframPlayer processes never exit, even after clicking Restart or existing VS Code.
This results in an infinite accumulation of Wolfram processes, which in turn causes various problems, including resource pollution and being unable to start new kernels due to license limits being exceeded by the dangling processes.
I looked into the problem a bit and noticed that WolframKernel and WolframPlayer both seem to ignore SIGTERM signals which is the signal they are being sent in this scenario (verified using gdb).
Ignoring SIGTERM signals seems like a Wolfram Engine bug, which I just reported to support@wolfram.com ([CASE:4971169]). In the meantime maybe the jupyter kernel can be updated to work around this issue, e.g. by sending a different signal on exit?
This is not reproducible using the standard Jupyter Notebook (as opposed to VS Code) because the Wolfram processes appear to be sent SIGINT (which they handle correctly) in this case.
When using the Wolfram kernel in Jupyter running inside the VS Code Jupyter extension on a Linux machine, the
WolframKernel
andWolframPlayer
processes never exit, even after clickingRestart
or existing VS Code.This results in an infinite accumulation of Wolfram processes, which in turn causes various problems, including resource pollution and being unable to start new kernels due to license limits being exceeded by the dangling processes.
I looked into the problem a bit and noticed that
WolframKernel
andWolframPlayer
both seem to ignore SIGTERM signals which is the signal they are being sent in this scenario (verified usinggdb
).Ignoring SIGTERM signals seems like a Wolfram Engine bug, which I just reported to support@wolfram.com (
[CASE:4971169]
). In the meantime maybe the jupyter kernel can be updated to work around this issue, e.g. by sending a different signal on exit?This is not reproducible using the standard Jupyter Notebook (as opposed to VS Code) because the Wolfram processes appear to be sent SIGINT (which they handle correctly) in this case.