Conversation
tunnel stall Five root causes of degradation under load and after restart: 1. readLoop 5s backpressure blocked entire tunnel per stuck connection: one ConnID with full buffer caused ALL other ConnIDs on the same TunnelConn to stall for 5 seconds per frame. Reverted to immediate drop (with log) so readLoop never blocks. 2. Reorderer gap-skip only triggered on new frame arrival: if no more frames arrived, Next() was never called again and the timer never expired — connection hung forever. Added 500ms gapTicker in RelayUpstreamToClient to drive gap-skip and detect idle connections (30s idle → give up and close). 3. CentralServer had no idle-based cleanup after 5-min hard limit was removed: stuck connections accumulated indefinitely. Added lastActive tracking with 60s idle eviction, checked every 15 seconds. 4. IncrConns() called on all N instances per user connection inflated dashboard count by N× (40 users × 10 instances = 400 shown, not 40). Fixed to track on one instance only. 5. After restart, user connections arrived before any tunnel was ready, causing immediate SYN failures and reconnect storms. Added HasTunnels() fast-fail and WaitReady() helper on TunnelPool. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
tunnel stall
Five root causes of degradation under load and after restart:
readLoop 5s backpressure blocked entire tunnel per stuck connection: one ConnID with full buffer caused ALL other ConnIDs on the same TunnelConn to stall for 5 seconds per frame. Reverted to immediate drop (with log) so readLoop never blocks.
Reorderer gap-skip only triggered on new frame arrival: if no more frames arrived, Next() was never called again and the timer never expired — connection hung forever. Added 500ms gapTicker in RelayUpstreamToClient to drive gap-skip and detect idle connections (30s idle → give up and close).
CentralServer had no idle-based cleanup after 5-min hard limit was removed: stuck connections accumulated indefinitely. Added lastActive tracking with 60s idle eviction, checked every 15 seconds.
IncrConns() called on all N instances per user connection inflated dashboard count by N× (40 users × 10 instances = 400 shown, not 40). Fixed to track on one instance only.
After restart, user connections arrived before any tunnel was ready, causing immediate SYN failures and reconnect storms. Added HasTunnels() fast-fail and WaitReady() helper on TunnelPool.