Skip to content

head-lag: a stalled Serialized socket was scored as 100 s of provider lag - #2986

Merged
Flotapponnier merged 1 commit into
mainfrom
hotfix/serialized-stall-detection
Oct 15, 2026
Merged

Flotapponnier merged 1 commit into
mainfrom
hotfix/serialized-stall-detection

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

On 2026-10-14 the us-east probe read Serialized at 60-118 s, while eu-west and sgp read under 1 s and the other feeds in the same process read 1-3 s. Most of those spikes fall in windows where every socket on that box was dropping: the reference node, Mobula, OKX and GeckoTerminal. The other feeds redial within seconds. The Serialized client waited out a 90 s read deadline, so when a frozen path resumed, its whole backlog arrived at once.

Changes

  • Faster stall detection: ping every 10 s and read with a 20 s deadline, which allows two missed pongs. Tested against ws.serialized.xyz on an idle socket for 70 s: pongs return in about 100 ms.
  • Backoff reset: the reconnect backoff now resets after a session that streamed for more than 2 min. Before this, every drop after the fifth waited the full 60 s.
  • Per-trade slow log: any trade over 3 s is logged with its hash, Serialized's at and our receive time. The next spike can then be checked tx by tx against their own send logs.
  • Duplicate deliveries: a trade delivered twice is dropped and logged. The race book no longer scores a re-delivery after its race has closed as a late arrival.

Not in this PR

The head_lag_seconds gauge still holds the last value until a newer trade replaces it. That is shared by every feed, so it gets its own change.

… lag (#2985)

On 2026-10-14 the us-east probe read Serialized at 60-118 s while
eu-west and sgp read under 1 s and the other feeds in the same process
read 1-3 s. Most spikes fall in windows where every socket on that box
was dropping (reference node, Mobula, OKX, GeckoTerminal). The others
redial within seconds; the Serialized client waited out a 90 s read
deadline, so a frozen path that resumed delivered its backlog at once.

- ping every 10 s and read with a 20 s deadline (two missed pongs);
  verified against ws.serialized.xyz, pongs return in ~100 ms
- reset the reconnect backoff after a session that streamed for over
  2 min; every drop after the fifth was waiting the 60 s ceiling
- log each trade over 3 s with hash, Serialized's `at` and our receive
  time, so the next spike can be checked tx by tx against their logs
- drop and log a trade delivered twice, and do not score a re-delivery
  after its race closed as a late arrival

(cherry picked from commit 19294fb)
@Flotapponnier
Flotapponnier merged commit c609dd8 into main Oct 15, 2026
2 checks passed
@Flotapponnier
Flotapponnier deleted the hotfix/serialized-stall-detection branch November 3, 2026 11:52
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