Repository navigation
perf(ssh): send a single keepalive after wake, not two - #9880
Merged
Merged
Conversation
Co-authored-by: Orca <[email protected]>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe SSH channel multiplexer now detects long timer gaps after system sleep, refreshes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
Co-authored-by: Orca <[email protected]>
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.
What
On the first SSH connection-health tick after a sleep/App-Nap wake, the multiplexer sent a keepalive, then detected the wake gap (
sinceLastTick > WAKE_GAP_MS), rebaselined liveness, and immediately sent a second keepalive — so every SSH connection emitted two protocol writes per wake.Fix: on the wake-gap branch, rebaseline
lastReceivedAt/ unacked timestamps before the tick's single keepalive, then skip the liveness evaluation for that one tick. Net: exactly one fresh probe per connection per wake; the wake is still detected and liveness still rebaselined; steady-state (non-wake) cadence and dead-link detection are unchanged.ELI5
When your laptop wakes from sleep, Orca pings each SSH connection once to check it's still alive. It was accidentally pinging twice. Now it pings once.
Proof of zero regression
#7773wake-gap recovery is preserved:lastReceivedAtand every unacked-message timestamp are still reset on wake (just before the single probe instead of around a duplicate one), so a healthy link isn't killed after sleep.ssh-channel-multiplexer.test.ts28/28 — tightened to assert exactly one keepalive per cadence tick, added two-connection wake coverage (one probe per multiplexer), and explicit assertions that receive + unacked timestamps are rebaselined on wake.typecheck:nodeclean.Proof of perf improvement
Removes one redundant SSH protocol write per connection per wake — the test asserts exactly one keepalive is sent on the post-wake tick (was two). Small but pure wake-cost reduction that scales with the number of open SSH connections.
Made with Orca 🐋