Never shield-wait `ipc_server.wait_for_no_more_peers()`

As mentioned in prior testing commit, it can cause the worst kind of
hangs, the SIGINT ignoring kind.. Pretty sure there was never any reason
outside some esoteric multi-actor debugging case, and pretty sure that
already was solved?
to_asyncio_eoc_signal
Tyler Goodlet 2025-07-15 17:28:48 -04:00
parent dd7aca539f
commit 4ca81e39e6
2 changed files with 8 additions and 6 deletions

View File

@ -1760,9 +1760,7 @@ async def async_main(
f' {pformat(ipc_server._peers)}'
)
log.runtime(teardown_report)
await ipc_server.wait_for_no_more_peers(
shield=True,
)
await ipc_server.wait_for_no_more_peers()
teardown_report += (
'-]> all peer channels are complete.\n'

View File

@ -814,10 +814,14 @@ class Server(Struct):
async def wait_for_no_more_peers(
self,
shield: bool = False,
# XXX, should this even be allowed?
# -> i've seen it cause hangs on teardown
# in `test_resource_cache.py`
# _shield: bool = False,
) -> None:
with trio.CancelScope(shield=shield):
await self._no_more_peers.wait()
# with trio.CancelScope(shield=_shield):
# await self._no_more_peers.wait()
async def wait_for_peer(
self,