Skip to content

Pings and pongs arriving back to back stop at the deadline - #117

Merged
sepehr-safari merged 2 commits into
mainfrom
pings-do-not-outlast-a-deadline
Sep 23, 2026
Merged

sepehr-safari merged 2 commits into
mainfrom
pings-do-not-outlast-a-deadline

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

Closes #116.

receiveUntil consumed ping and pong frames and went straight on to the next frame without looking at the clock, and the deadline given to receiveTimeout is otherwise noticed only when the socket runs dry. A relay sending control frames back to back held the call past its deadline for as long as it kept going. 0.14.3 added this check after a message the parser cannot read; control frames were left out.

The clock is now checked after every frame the caller never sees, through one helper the unreadable-message path shares. Returning there still consumes nothing the caller would have seen, since a ping or pong carries no message.

Tests

pings and pongs arriving back to back still stop at the deadline gives an already-passed deadline to a pong, then a ping, then a NOTICE. It expects error.Timeout after each control frame, the ping answered, and the NOTICE on the next call. Removing the check after the ping, or after the pong, each fails it.

All 212 tests pass.

Release

The last commit bumps the version to 0.14.5.

receiveUntil consumed ping and pong frames and went on to the next frame without looking at the clock, and the deadline is otherwise noticed only when the socket runs dry. A relay sending control frames back to back held receiveTimeout past its deadline for as long as it kept going. The clock is now checked after every frame the caller never sees, through one helper that the unreadable-message path shares.

Closes #116.
Carries the fix on this branch: a deadline holds while pings and pongs are arriving.
@sepehr-safari
sepehr-safari merged commit bb3c054 into main Sep 23, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the pings-do-not-outlast-a-deadline branch September 23, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pings and pongs arriving back to back hold receiveTimeout past its deadline

1 participant