• Hugo Benichi's avatar
    arc: net: Prevent Service property update loops · e8a77430
    Hugo Benichi authored
    To ensure that ARC would consistently get IP properties from the host
    for all networks, change-id I24d26d6492f133e0c38949c8c3b4403687bfac21
    (https://chromium-review.googlesource.com/c/chromium/src/+/2028881)
    added a delayed property update request to shill when ArcNetHostImpl
    cannot retrieve IP properties for a Shill connected Service.
    
    However, one such request will trigger multiple property updates from
    Shill and will retrigger the same codepath in ArcNetHostImpl that asked
    for the property update request. This amplification can lead to an
    infinite loop between Chrome and Shill incurring high CPU usage on the
    system when ArcNetHostImpl will keep failing to find the IP properties
    from the ONC properties or from the Device cached state.
    
    This patch prevents this loop from happening at a high frequency by
    making sure that at most one delayed property update request is
    scheduled. A follow-up patch will add exponential backoff for the retry
    delays.
    
    It was reported in crbug/1054676 to happen consistently for the case of
    native VPNs backed by a WiFi connection (i.e it does not happen with
    VPNs backed by ethernet). The reason why ArcNetHostImpl fails to find IP
    properties in that specific scenario is still unknown and will be
    investigated separately.
    
    BUG=1054676
    TEST=Compiled, connected L2TP VPNs, observed that logs patterns seen in
    crbug/1054676 do not happen and that cpu% of shill, chronos, and
    system_server stays at normal levels.
    
    Change-Id: I2a39ba9c8d14cf42b6b0dbdd10c885bf5be09cfa
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078372
    Commit-Queue: Hugo Benichi <hugobenichi@google.com>
    Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#746192}
    e8a77430
arc_net_host_impl.cc 44.6 KB