-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Currently encountering in #82 . Local testing shows the /testing/abstract_method/test_good.py hangs on the context manager running the daemon as a subprocess. Hangs on exit.
<6> INFO : 2025-10-19T11:58:22-0500 : test : Connection made from ('127.0.0.1', 34360) to test
<6> INFO : 2025-10-19T11:58:22-0500 : yaqd_core : Received signal SIGTERM...
<6> INFO : 2025-10-19T11:58:22-0500 : yaqd_core : Cancelling 4 outstanding tasks
Traceback from interrupting (i.e. manual SIGINT does kill the process):
yaqd-core/yaqd_core/testing/_run_daemon.py", line 41, in wrapper
with subprocess.Popen([sys.executable, pyfile, "--config", config]) as proc:
File "/usr/lib/python3.12/subprocess.py", line 1118, in __exit__
self.wait()
File "/usr/lib/python3.12/subprocess.py", line 1264, in wait
return self._wait(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 2053, in _wait
(pid, sts) = self._try_wait(0)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 2011, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterruptThe daemon is getting stuck on shutdown. Though logging, I find that shutdown gets stuck at asyncio.gather
yaq-python/yaqd-core/yaqd_core/_is_daemon.py
Line 301 in 39733a9
| await asyncio.gather(*tasks, return_exceptions=True) |
I believe the hanging task is for asyncio.serve_forever. If I pop this from the list of tasks, gather does complete.
If the test tells the individual daemon to shutdown, i.e.
@testing.run_daemon_from_file(here / "good.py", here / "config.toml")
def test_good():
c = yaqc.Client(39425)
c.shutdown()the subprocess does not hang when the wrapper terminates the daemons.
Metadata
Metadata
Assignees
Labels
No labels