Commit 522a665
authored
[thread-cert] handle BrokenPipeError on resetting node in simulator (openthread#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.1 parent c9d3215 commit 522a665
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
515 | 520 | | |
516 | 521 | | |
517 | 522 | | |
| |||
0 commit comments