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

Fix stress test hang: retry on SendToError in echo server - #398

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

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

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

The echo server in the UDP flood stress test silently dropped datagrams when send_to returned SendToError. The client hangs forever waiting for an echo that will never arrive — _recv_cursor never reaches _send_cursor.

SendToError on loopback is typically transient: ECONNREFUSED from a stale ICMP port-unreachable error queued on the socket. The stash-and-retry mechanism already existed for SendToWouldBlock; this change adds SendToError to the same code path.

The old _drain_stash handler for SendToError had a double bug: it dropped the datagram AND didn't reschedule the drain, orphaning everything remaining in the stash.

The echo server was dropping datagrams when send_to returned
SendToError, causing the client to hang forever waiting for an echo
that will never arrive. Treat SendToError the same as SendToWouldBlock:
stash the datagram and retry via the deferred _drain_stash behavior.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Sep 6, 2026
@SeanTAllen

Copy link
Copy Markdown
Member Author

Closing in favor of a full stress test redesign — the retry approach masks errors the test should be catching.

@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
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