Repository navigation
Conversation
…hile inactive Recovery loops follow NWPathMonitor: they wait for the path instead of spending attempts and redial at once when it comes back or changes interface. A path change and a wake check direct sessions too; the health interval stretches to the freshness window while the app is inactive; the ping is a turn on the session driver gate.
This branch has not been deployed
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.
Summary
NWPathMonitor). While the path is down, a connection that leaves this Mac waits for it instead of spending attempts, and an attempt the path dropped under is not counted. When the path comes back, or moves to other interfaces (a Wi-Fi rejoin, a VPN), every waiting loop's backoff sleep is cut short and it redials at once. Backoff still applies to a server that refuses. A server on loopback or a local socket keeps redialing with no path.ConnectionHealthCheck.freshness(300 s) between pings;verifyBeforeUsecovers the return. Monitors start again ondidBecomeActive, back on the configured interval. The monitor reads the interval once per pass.Measured with the unit tests: with the path down, a loop that has waited out its backoff dials nothing and waits for the path, where it used to spend an attempt each step until all 10 were gone (
noAttemptWhileThePathIsDown); a path return redials without waiting out the backoff (pathReturnRetriesAtOnce). In the background, 10 connections on the default setting ping at most once per connection per 300 s, from about 20 pings a minute. The Wi-Fi-off timings were not run here.Test plan
SessionRecoveryNetworkTests(new): no attempt while the path is down, an immediate redial on path return and on an interface change, loopback ignores the path, the inactive interval, and the gated ping. Each fails on main.SessionRecoveryNetworkTests,SessionRecoveryLoopTests,ConnectionHealthMonitorHandoffTests,ConnectionHealthMonitorRetryTests,ReconnectDegradationTests: 55 executed, 55 passed.Closes #4546