Repository navigation
fix(envoy-client): ignore pings from earlier connections in the silence check - #5838
Conversation
ReviewSmall, well-reasoned fix. The new integration test drives a real envoy through a reconnect. What it does: Notes
Style matches CLAUDE.md (hard tabs, tests under |
| // A ping from an earlier connection says nothing about this one. Clearing it keeps the engine | ||
| // ping silence check disabled until this connection receives its first ping. | ||
| shared.last_ping_ts.store(0, Ordering::Release); |
There was a problem hiding this comment.
🔴 High · Keep a deadline before the first ping
Clearing this to the sentinel disables the only ping-silence deadline for the new session. ToEnvoyInit subsequently clears lost_timeout, so if the engine sends Init and commands and then crashes or the link becomes half-open before its first ping, engine_ping_silence_deadline_ms returns None forever while the newly started actors keep running; the engine can meanwhile declare this envoy lost and reallocate them, violating the single-writer invariant. Track a separate per-session/Init baseline (or equivalent first-ping grace deadline) so the old ping is ignored without leaving the pre-first-ping state unbounded.
There was a problem hiding this comment.
slop? the engine sends Init b4 it refreshes the envoys liveness
conn.rs:146 send Init ← envoy would reset its silence baseline here
conn.rs:278 claim_registration
conn.rs:423 write LastPingTsKey ← engine resets its clock here (or not, if the claim fails)
conn.rs:293 send missed commands
lib.rs:249 ping task → update_ping, then ping
6a97303 to
33530e0
Compare
33530e0 to
6a97303
Compare
|
Stack for rivet-dev/rivet Current stack:
Dependencies: Get stack: change uxuuvwzu |
831507a to
4ef21a9
Compare
6a97303 to
27a48b9
Compare
No description provided.