Broken cancel() assumption on BackgroundLoader when saving causes copious amount of EXPIRED requests |
|||||
Issue descriptionRare case: Repro: - RequestCoordinator calls Cancel() while BL is in the middle of a SavePage - BL sets "DeleteAfterSave" to be true and returns - RequestCoordinator, thinking it's cancelled, then bombards BL with requests, but BL still working on actual save, so returns false - Results in ~50 requests being EXPIRED within 10 seconds Proposed short fix: - in BackgroundLoaderOffliner::Cancel(), if a save operation is in progress, pass the WebContents pointer to something else that will be deleted later after Save completes. - in BackgroundLoaderOffliner::OnPageSaved(), check to see if offline_id matches with current pending_request_. If it doesn't, ignore the call and delete the pointer holding onto the old WebContents. Longer-term fix/solution: - We can have RequestCoordinator observe the SavePage calls so that the timer is only for page load rather than page load + save - This can be further improved to start a new request once we start the Save process.
,
Mar 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9f04f39d54f599a346c59670f91923f4af05e416 commit 9f04f39d54f599a346c59670f91923f4af05e416 Author: chili <chili@chromium.org> Date: Sat Mar 04 01:23:56 2017 [Offline Pages] Turn Offliner::Cancel into an async operation to resolve conflicting assumptions between the Offliner and RequestCoordinator. Upon Offliner::Cancel, RequestCoordinator assumes that the offliner is free, but offliner may be waiting until save operation to complete. This discrepancy causes RequestCoordinator to bombard the offliner with all the pending requests, potentially blocking the main thread for the save operation callback to be called and causing all pending requests to be labeled as EXPIRED BUG= 694864 Review-Url: https://codereview.chromium.org/2715433006 Cr-Commit-Position: refs/heads/master@{#454740} [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/chrome/browser/android/offline_pages/background_loader_offliner.cc [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/chrome/browser/android/offline_pages/background_loader_offliner.h [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/chrome/browser/android/offline_pages/prerendering_offliner.cc [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/chrome/browser/android/offline_pages/prerendering_offliner.h [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/components/offline_pages/core/background/offliner.h [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/components/offline_pages/core/background/offliner_stub.cc [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/components/offline_pages/core/background/offliner_stub.h [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/components/offline_pages/core/background/request_coordinator.cc [modify] https://crrev.com/9f04f39d54f599a346c59670f91923f4af05e416/components/offline_pages/core/background/request_coordinator.h
,
Mar 7 2017
,
Mar 9 2017
,
Mar 9 2017
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions. Owners: amineer@(clank), cmasso@(bling), bhthompson@(cros), govind@(desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dedea73d3b658d752873cadbc162c84f88bcd878 commit dedea73d3b658d752873cadbc162c84f88bcd878 Author: Dmitry Titov <dimich@chromium.org> Date: Fri Mar 10 01:24:15 2017 [Offline Pages] Turn Offliner::Cancel into an async operation to resolve conflicting assumptions between the Offliner and RequestCoordinator. Upon Offliner::Cancel, RequestCoordinator assumes that the offliner is free, but offliner may be waiting until save operation to complete. This discrepancy causes RequestCoordinator to bombard the offliner with all the pending requests, potentially blocking the main thread for the save operation callback to be called and causing all pending requests to be labeled as EXPIRED BUG= 694864 Review-Url: https://codereview.chromium.org/2715433006 Cr-Commit-Position: refs/heads/master@{#454740} (cherry picked from commit 9f04f39d54f599a346c59670f91923f4af05e416) Review-Url: https://codereview.chromium.org/2744553005 . Cr-Commit-Position: refs/branch-heads/3029@{#105} Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471} [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/chrome/browser/android/offline_pages/background_loader_offliner.cc [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/chrome/browser/android/offline_pages/background_loader_offliner.h [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/chrome/browser/android/offline_pages/prerendering_offliner.cc [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/chrome/browser/android/offline_pages/prerendering_offliner.h [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/components/offline_pages/core/background/offliner.h [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/components/offline_pages/core/background/offliner_stub.cc [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/components/offline_pages/core/background/offliner_stub.h [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/components/offline_pages/core/background/request_coordinator.cc [modify] https://crrev.com/dedea73d3b658d752873cadbc162c84f88bcd878/components/offline_pages/core/background/request_coordinator.h |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by chili@chromium.org
, Feb 22 2017