Repository navigation
Conversation
The engine starts each network's weight from the speed Android reports, and keeps it until every network has been measured. With a floor of 0.1 a network the system rates slower (Wi-Fi 6 link speed against 4G, for example) gets no new connections until the other has ten open, so it is never measured and the app shows mobile data or Wi-Fi unused. A floor of 0.5 gives it at least one connection in three, so it carries traffic and is measured, after which the measured speeds take over. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A store update or a download manager opens a few connections to one server. They were placed by the global open-flow count, which other apps' idle connections make arbitrary, so the parts landed on one network or the other at random and "Split evenly" changed nothing. A new connection to a server that already has open connections now goes to the network with the fewest of them. Speed weights still count, loosely: none counts for less than half of the fastest, and a network clearly slower than a fifth of the fastest is left out. The first connection to a server is placed as before. Co-Authored-By: Claude Sonnet 5.5 <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.
Fixes the "mobile data is not used with Wi-Fi" reports (net-merge/net-merge#69, #70).
Cause. The engine starts each network's weight from the speed Android reports for it (Wi-Fi 6 can claim 1 Gbit/s while mobile data claims 145 Mbit/s), and keeps that weight until every network has been measured. The network that looks slower gets no new connections until the other one is busy, so it is never measured and stays unused. The old floor was 0.1.
Change. The floor is now 0.5: a network always gets at least one new connection in three until it has been measured. After that the measured speeds take over, as before. Two files in
golib/netmerge: the constant, and tests.Tests.
TestSlowLookingNetworkStillGetsFlows: 6 connections with Wi-Fi at 900 Mbit/s and mobile at 30 Mbit/s. It fails with the old floor (all 6 on Wi-Fi) and passes now.TestSystemEstimateSeedsWeightsis updated for the new floor.Known cost: a network that is really very slow (under about 0.4 Mbit/s, so it never counts as measured) keeps getting one connection in three. That is rare and the probe still sidelines a network with no internet.
Not related to the open PR #1: that change does not fix this (tested on two emulators; it also stops late-enabled mobile data from joining).
🤖 Generated with Claude Code