Closed coandco closed 5 months ago
Probably related but while running with PYTHONDEVMODE=1 I'm seeing:
/usr/lib/python3.11/subprocess.py:1127: ResourceWarning: subprocess 69652 is still running
Thank you for reporting this. I has been corrected in version 0.41.2
.
When you load office with
Lo.load_office(Lo.ConnectSocket(headless=True))
, three processes are created:If you then run
Lo.kill_office()
, it sends a SIGKILL toLo._lo_inst._lo_inst._soffice_process
, which in this case is "2". This results in the following processes running:As you can see, only the shell wrapper has actually been killed, and the actual soffice processes are untouched. I believe the correct way to handle this is to send the SIGKILL to the process represented by
Lo._lo_inst._lo_inst._soffice_process
and all children, either by giving it its own process group when you launch it (and then using os.killpg to kill the group) or via manual crawling of process children.