Connection migration on packet write error is controlled by "migrate_sessions_on_network_change_v2". Each single migration's usage of non-default network is bounded by "max_time_on_non_default_network_seconds".
A migration caused by platform notification uses some amount of non-default network usage is fine as user is very likely aware of the network switching.
A migration caused by packet write error uses non-default network is not expected by the user unless a platform notification is delivered later. Therefore, we'd like to make sure to not use unbounded data on a non-default network. In the worst case, however, bounding single migration's usage is not sufficient to achieve the goal. For example, a session
a)gets on the WiFi,
b)encounters a packet write error and starts connection migration
c)successfully migrates to the Cellular, starts to migrate back to default network - WiFi,
d)after some time, say delta_t < max_time_on_non_default_network_seconds, session successfully migrates back on the WiFi
If such process repeats and platform doesn't deliver any notification while this is happening, we may end up with doing multiple migrations while the default never changes.
To fix this issue, we will need to bound the number of migration for packet write error for each default network to prevent using non-default network too much.
Comment 1 by bugdroid1@chromium.org
, Aug 1