New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 719376 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Fix race condition in BrowsingDataCounter

Project Member Reported by dullweber@chromium.org, May 8 2017

Issue description

This cl showed that there is a race condition when a BrowsingDataCounter is restarted while it is counting:

https://codereview.chromium.org/2869683002/diff/1/chrome/browser/browsing_data/cache_counter.cc

To fix this there should be a virtual StopCounting() method that is implemented by all asynchronous counters in order to invalidate their weak_ptr_factory or stop cancellable tasks. This way they won't report a result when counting restarted.

Log output:

05-08 10:19:14.193 31093-31093/org.chromium.chrome E/chromium: [ERROR:cache_counter.cc(39)] START COUNTING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
05-08 10:19:14.278 31093-31093/org.chromium.chrome E/chromium: [ERROR:cache_counter.cc(63)] START COUNTING OFFLINE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
05-08 10:19:14.345 31093-31093/org.chromium.chrome E/chromium: [ERROR:cache_counter.cc(39)] START COUNTING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
05-08 10:19:14.345 31093-31093/org.chromium.chrome E/chromium: [ERROR:cache_counter.cc(81)] REPORT RESULT OFFLINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
05-08 10:19:14.358 31093-31093/org.chromium.chrome E/chromium: [ERROR:cache_counter.cc(63)] START COUNTING OFFLINE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
05-08 10:19:14.377 31093-31093/org.chromium.chrome E/chromium: [ERROR:cache_counter.cc(81)] REPORT RESULT OFFLINE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
05-08 10:19:14.420 31093-31093/org.chromium.chrome A/chromium: [FATAL:browsing_data_counter.cc(86)] Check failed: false. 

 
Status: Started (was: Untriaged)
Status: Fixed (was: Started)
Fixed by cancelling previous tasks in Count() instead of adding another virtual method.

Sign in to add a comment