Open guenp opened 4 years ago
After some investigation, I find that I can reproduce this on both Windows and Linux.
The qsharp
Python package starts the IQ# kernel process and registers an atexit
handler to shut down the process when the Python interpreter exits. However, if the Python process is killed in any "unclean" way, e.g., via an OS signal, the atexit
handler does not get called, and the IQ# kernel process remains running.
One way to fix this may be to have the IQ# kernel periodically check to see if it is still connected to a client, and exit gracefully if a client is not connected for some period of time.
Describe the bug Both @dgwvfxn and I noticed that when running a Jupyter notebook that is using the
qsharp
Python package, and after running a quantum algorithm in the notebook, in some situations an IQ# zombie process sticks around after exiting the Jupyter notebook.To Reproduce Steps to reproduce the behavior:
GetEnergyByTrotterization
from https://github.com/microsoft/Quantum/blob/main/samples/chemistry/MolecularHydrogen/HydrogenSimulation.qs)ps -ax | grep conda
Expected behavior When killing the Python kernel, I expect the IQ# kernel to also stop.
System information
Additional context @dgwvfxn experienced the issue before on a Linux machine but was not able to reproduce it later.