You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bound mobile reconnects and slow retries to offline Tailscale hosts - #47217
Orca Mobile gives a newly available network a short chance to recover while slowing passive retries to saved Tailscale hosts that keep failing.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$33
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$33
Prod
4
$\color{#1a7f37}{\Huge{\mathbf{+}}}$147
$\color{#cf222e}{\Huge{\mathbf{−}}}$47
$\color{#1a7f37}{\Huge{\mathbf{+}}}$100
What Changed
A network callback burst gets one immediate retry and a bounded follow-up. A quickly refused first retry can try once more after at most two seconds. A follow-up lets a new dial run for at least four seconds before replacing it. Repeated callbacks during the same burst leave the active retry schedule in place.
Focus and older downloaded pages' Retry can advance a scheduled retry and leave an in-flight dial alone. Accelerated dials preserve the numeric backoff step. App resume retains its normal fresh retry budget for a previously reachable host.
A saved Tailscale host that has never authenticated this session moves to five-minute automatic retries after exhausting the standard attempts. Passive network hints respect a two-minute minimum between dials. Returning from the background has a separate retry budget, so a recent timer dial cannot consume it. An explicit focus or Retry can still dial immediately. The dormant timer skips dialing outside the foreground.
Why
The iOS VPN can report a restored path before traffic can use it. Resetting backoff on each passive callback creates repeated connections to an unreachable host. Holding back every later callback can leave a recovered host stuck on a long retry timer.
Traffic to an offline peer also triggers a WireGuard buffer-pool stall in Tailscale's stable iOS 1.104.7 configuration. I reproduced it with that release's actual wireguard-go module and iOS queue options in the upstream loopback test. The healthy peer first timed out when the pool filled at 1 minute 37 seconds. Traffic resumed at 3 minutes 17 seconds when the queue drained. The fixed TestFlight module kept the healthy peer reachable for the same four-minute workload. This points to keeping needless offline traffic quiet and preserving a prompt recovery path.
Claude Opus and Gemini 4 Neon independently reviewed the previous revisions. The current policy addresses their repeatable recovery and retry-pressure findings. I replayed the worker's controlled socket scenarios using the production direct client.
Scenario
Earlier revision
Current implementation
Tunnel becomes reachable one second after a lone network hint
60 seconds
2 seconds
Two early hints during a healthy three-second handshake
5.5 seconds, two dials
3 seconds, one dial
Toggle and return after launching during an outage
60.5 seconds in the dormancy prototype
Immediate when eligible
Toggle and return after a recent failed dormant dial
252 seconds
Immediate on the first app return
Tailscale toggle after a long outage with a previously connected host
90 seconds on the earlier sliding-window version
2 seconds
Unreachable host with a five-second callback cadence over two minutes
96 dials on main
4 dials
The replay also verified older-page Retry, app-resume request budgets, focus storms, ten-second callback cadence, and an independent healthy host while a second host was offline. All 21 replay cases, five existing delivery-ambiguity tests, and the new dormant app-return regression test passed. All 17 local changed checks passed.
The simulation uses controlled socket events. Physical verification and tap-by-tap timing on the reporter's iPhone are pending.
Performance
At most one network follow-up timer per direct client during a burst. Authentication, close, and terminal authentication failure cancel it. Automatic retries to an exhausted offline Tailscale host are less frequent.
Risk
Level: Medium. Continuous network hints can use up the burst's expedited retries while a path is still unavailable. The regular schedule and user-driven Retry remain available, and dormant automatic retries have an explicit interval. The bridge and wire types are unchanged. A plain revert restores the previous retry behavior.
Agent skill upstream boundary
No upstream agent skill source or artifacts were copied.
RpcClientReconnectSchedule handles network-change hints with an immediate retry on the first hint or after a 10-second interval. It allows one delayed follow-up retry after closely spaced hints. Authentication clears hint state, and cancel() clears both reconnect and follow-up timers. DirectRpcClient.notifyForeground routes network-change notifications through this policy and handles other reasons directly. It closes stale dials only for non-focus notifications.
Merge Risk: Moderate · up to 7353d
Tapping Retry on the offline banner after a long outage now dials once and then waits up to 90 seconds before the next attempt, instead of resuming normal backoff. Restore the attempt reset for focus-triggered retries from scheduled backoff before merging.
Pre-merge checks: 3 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Description check
The description follows the template and covers most required sections: ELI5, What Changed, Why, Validation (testing evidence), Performance, Risk with a Level, and the Agent skill upstream boundary ch…
1. In Linked Issue, replace the 'Refs' lines with an actual closing reference such as 'Fixes #' for an issue this PR resolves, or state that the author is a maintainer and attach the existing issue. 2. In Visual Proof, add a BEFORE a…
Passed checks: 3 passed
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title names the main change: reconnect and retry behavior for Orca Mobile direct connections is bounded when saved Tailscale hosts are offline. The changeset adds network-hint retry handling in th…
Full details: Title check
Explanation
The title names the main change: reconnect and retry behavior for Orca Mobile direct connections is bounded when saved Tailscale hosts are offline. The changeset adds network-hint retry handling in the reconnect schedule and slows automatic retries to exhausted offline Tailscale hosts, so the title matches the primary intent. It is 67 characters, which is within a reasonable title length.
Full details: Description check
Explanation
The description follows the template and covers most required sections: ELI5, What Changed, Why, Validation (testing evidence), Performance, Risk with a Level, and the Agent skill upstream boundary checkbox. Gaps: the Linked Issue section does not contain a 'Fixes #' issue link. It lists 'Refs' to several issues, which the template says is not sufficient for outside contributors. The Visual Proof section is missing: the change affects mobile reconnect behavior, so it needs either a before/after capture or an explicit 'N/A' with a reason. The description also says physical iPhone verification is pending. The Testing section does not use the template's checklist (the manual test, automated test, and anti-pattern boxes are not marked). The AI Disclosure section is absent, though it is only needed for non-team contributors. The Performance section gives a one-line answer, which is acceptable. The description is mostly complete, but the missing Linked Issue closure and Visual Proof make it incomplete.
Resolution
In Linked Issue, replace the 'Refs' lines with an actual closing reference such as 'Fixes #<issue>' for an issue this PR resolves, or state that the author is a maintainer and attach the existing issue. 2. In Visual Proof, add a BEFORE and AFTER capture (video preferred) of the reconnect behavior, or write 'N/A' with a reason. Note that the physical iPhone capture is still pending. 3. In Testing, mark the checklist items that apply, and state which platforms were tested (the physical iOS test is pending, so say so). 4. If the author is an outside contributor, complete the AI Disclosure section if AI tools were used for the code or the review.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Use the dormant retry approach from #36352 for cold Tailnet endpoints, while keeping a direct retry available when the user opens the host. Coalesce repeated native callbacks over the cadence observed on iOS.
Co-authored-by: lucas persson <[email protected]>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Restore the attempt reset when focus starts from scheduled backoff.
Line 210 passes false to redialNow for every focus call. A focus call from reconnecting does not reach the stale-dial branch, so the merge-base code reset attempts for this input. The current code keeps the attempt count. The offline banner's Retry action uses focus, so a Retry at attempt 12 dials once. If that dial fails, the client waits the 90-second trickle delay instead of the normal backoff.
Reset attempts for focus. Keep them unchanged for network-change, which the PR intends to exclude from resetting the counter. Stale-dial replacement already captures connecting or handshaking, so it keeps its current behavior.
nwparker
changed the title
Keep Orca Mobile direct reconnects on backoff during repeated network hints
Bound mobile reconnects and slow retries to offline Tailscale hosts
Nov 23, 2026
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
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.
ELI5
Orca Mobile gives a newly available network a short chance to recover while slowing passive retries to saved Tailscale hosts that keep failing.
What Changed
Why
The iOS VPN can report a restored path before traffic can use it. Resetting backoff on each passive callback creates repeated connections to an unreachable host. Holding back every later callback can leave a recovered host stuck on a long retry timer.
Traffic to an offline peer also triggers a WireGuard buffer-pool stall in Tailscale's stable iOS 1.104.7 configuration. I reproduced it with that release's actual wireguard-go module and iOS queue options in the upstream loopback test. The healthy peer first timed out when the pool filled at 1 minute 37 seconds. Traffic resumed at 3 minutes 17 seconds when the queue drained. The fixed TestFlight module kept the healthy peer reachable for the same four-minute workload. This points to keeping needless offline traffic quiet and preserving a prompt recovery path.
Linked Issue
Refs #31580, #19111, #46828, and #13354. Incorporates the dormant-host approach from @luben93's #36352, which overlaps this PR and has conflicts with current main. The physical iPhone failure from #31580 still needs a capture. Tailscale upstream issue
Validation
Claude Opus and Gemini 4 Neon independently reviewed the previous revisions. The current policy addresses their repeatable recovery and retry-pressure findings. I replayed the worker's controlled socket scenarios using the production direct client.
The replay also verified older-page Retry, app-resume request budgets, focus storms, ten-second callback cadence, and an independent healthy host while a second host was offline. All 21 replay cases, five existing delivery-ambiguity tests, and the new dormant app-return regression test passed. All 17 local changed checks passed.
The simulation uses controlled socket events. Physical verification and tap-by-tap timing on the reporter's iPhone are pending.
Performance
At most one network follow-up timer per direct client during a burst. Authentication, close, and terminal authentication failure cancel it. Automatic retries to an exhausted offline Tailscale host are less frequent.
Risk
Level: Medium. Continuous network hints can use up the burst's expedited retries while a path is still unavailable. The regular schedule and user-driven Retry remain available, and dormant automatic retries have an explicit interval. The bridge and wire types are unchanged. A plain revert restores the previous retry behavior.
Agent skill upstream boundary