fix(sensing-server): handle WebSocket Lagged + add ping keepalive#484
Open
schwarztim wants to merge 1 commit intoruvnet:mainfrom
Open
fix(sensing-server): handle WebSocket Lagged + add ping keepalive#484schwarztim wants to merge 1 commit intoruvnet:mainfrom
schwarztim wants to merge 1 commit intoruvnet:mainfrom
Conversation
Root cause: broadcast channel Lagged error caused instant disconnect when clients fell behind 256 frames (10Hz * 50-200KB = easy to lag). Client reconnects, immediately lags again, rapid cycling ensues. Sensing handler: Lagged error now continues (skips missed frames) instead of breaking. Added 30s ping interval for proxy keepalive. Pose handler: same Lagged handling + Pong match arm. CHANGELOG updated under Unreleased/Fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Dashboard WebSocket clients were rapid-cycling (connect/disconnect every 2-4s) under load. Root cause: the broadcast channel raises
RecvError::Laggedwhen a slow consumer falls behind the 256-frame buffer (10 Hz ingest × 50-200 KB frames makes this easy to hit), which the handler treated as a fatal error and closed the connection. Long idle periods also let proxies time out the connection.Changes
v2/crates/wifi-densepose-sensing-server/src/main.rs: catchRecvError::Laggedin bothhandle_ws_clientandhandle_ws_pose_clientand continue (drop missed messages, log debug); add 30s ping keepalive on the sensing handler.Test results
cargo test --workspace --no-default-features: 1621 passed, 0 failedpython v1/data/proof/verify.py: pre-existing hash mismatch on this environment (numpy/scipy version); not caused by this change (confirmed identical failure on unmodifiedorigin/main)Notes
581daf4fwith automatic path adjustment (rust-port/→v2/).