Skip to content

Fix/ws path normalisation#44

Merged
blaspat merged 3 commits into
mainfrom
fix/ws-path-normalisation
Jun 21, 2026
Merged

Fix/ws path normalisation#44
blaspat merged 3 commits into
mainfrom
fix/ws-path-normalisation

Conversation

@blaspat

@blaspat blaspat commented Jun 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

blaspat added 3 commits June 20, 2026 21:12
Quinn review: if the server's route ever changes it is now findable
and editable in one place. No behavior change.

Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Before this change, pinger.Start() and d.Run() were both started
before the dispatcher's ReadLoop had acquired the connection. The
first pinger tick could fire before the dispatcher was inside its
read select, meaning the server's pong response arrived as an
"unsolicited pong" (handlePong: no active ping) and triggered
notifyError.

Fix: run d.Run in a goroutine and block for one 50ms read window
before starting the pinger. The server sends hello as the first frame
after connect, so one Read window is sufficient on any real network.
The pinger's onPing closure already handles the conn-close race
gracefully, so this is purely about eliminating the spurious
notifyError call on the first pong.

Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
The handlePong case was calling notifyError() for every pong that
arrived with no in-flight ping — an expected race condition, not a
real error. The old comment said "log and continue" but notifyError
fires OnError which prints a goroutine dump to stderr AND writes an
audit entry, making it look like a fatal dispatch failure.

Fix: remove the notifyError call entirely. An unsolicited pong means
the node is fine (got a pong from the server). Just return silently.

Also revert the previous attempt (goroutine + 50ms wait in
reconnect.go) — that added complexity without solving the race
because the pinger fires on its own interval, not immediately,
so by the time it ticks the 50ms window has long passed.

Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
@blaspat blaspat merged commit cdc25f3 into main Jun 21, 2026
@blaspat blaspat deleted the fix/ws-path-normalisation branch June 21, 2026 00:32
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.

1 participant