Files
Jonathan Hui 522a665187 [thread-cert] handle BrokenPipeError on resetting node in simulator (#13495)
When a simulated node restarts (e.g. during `factoryreset`), the
child process re-executes itself via `execvp`, disconnecting its
UNIX domain socket connection to the virtual-time simulator.

If `VirtualTime._send_message()` attempts to send an event before the
socket disconnection event has been processed by `selectors`,
`sock.send()` raises `BrokenPipeError` or `ConnectionResetError`,
even though the node is marked as temporarily offline in
`_maybeoff_ports` (via `maybeoff=True`).

This commit catches `BrokenPipeError` and `ConnectionResetError` in
`VirtualTime._send_message()`, verifying that the destination port is
present in `_maybeoff_ports` and skipping delivery cleanly.
2026-08-13 10:52:07 -07:00
..