Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Fix UDP stress test hang on SendToError - #399

Closed
SeanTAllen wants to merge 1 commit into
mainfrom
fix-udp-stress-hang
Closed

SeanTAllen wants to merge 1 commit into
mainfrom
fix-udp-stress-hang

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

The server's echo path silently dropped datagrams when send_to returned SendToError. The client waited forever for echoes that never came — the CI hang at run 34036971999 (5 Windows failures, 1 Linux failure out of 2730 runs per platform).

Two changes, both in the stress test:

Server retry. SendToError in _on_received now stashes the datagram and retries via _drain_stash, same as SendToWouldBlock. In _drain_stash, a bounded retry counter drops the datagram with a stderr diagnostic after 100 consecutive errors so a permanent error can't loop.

Client stall timer. A periodic timer closes the client and reports failure when no echoes arrive for an extended period. Safety net for any cause of missing echoes beyond SendToError.

No lori library changes — the ASIO edge-trigger semantics (EPOLLET, PSN, EV_CLEAR) and the _pending_reads / _read_again chain were traced and verified correct across all three platforms.

The server's echo path silently dropped datagrams when send_to returned
SendToError. The client waited forever for echoes that never came.

Server: stash SendToError the same as SendToWouldBlock and retry via
_drain_stash. Drop with a diagnostic after 100 consecutive errors on
the same datagram so a permanent error can't loop forever.

Client: a periodic stall timer closes the socket and reports failure
when no echoes arrive for an extended period. Safety net for any cause
of missing echoes, not just SendToError.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Sep 6, 2026
@SeanTAllen SeanTAllen closed this Sep 6, 2026
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Sep 6, 2026
@SeanTAllen
SeanTAllen deleted the fix-udp-stress-hang branch September 6, 2026 19:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants