DoomPartialEntry should not attempt to doom an already doomed entry

Desktop / Chromium - shivanisha [chromium.org] - 14 July 2017 16:32 EDT

I was not able to reproduce the crash reported but here is a speculative fix.

This is a scenario where a partial transaction needs to create a new entry and doom the existing one since it cannot validate itself against the new entry, due to, say, there are no strong validators.

The crash requires a specific race with another transaction for the same entry with LOAD_BYPASS_CACHE set due to which the second transaction straight away goes and dooms the entry (DoDoomEntry*) while the first one had opened the entry but not yet reached DoomPartialEntry.

This race is much more likely after the parallel validation CL (https://codereview.chromium.org/2721933002) because add to entry is always an async operation now.

This CL adds a check that the entry is not already doomed before calling cache_->DoomEntry in DoomPartialEntry and in one other calling location in DoSuccessfulSendRequest as it may happen there as well.

BUG=736993

Review-Url: https://codereview.chromium.org/2970133002 Cr-Commit-Position: refs/heads/master@{#486869}

2b6e7ee DoomPartialEntry should not attempt to doom an already doomed entry.
net/http/http_cache.h | 4 +-
net/http/http_cache_transaction.cc | 9 +-
net/http/http_cache_unittest.cc | 188 ++++++++++++++++++++++++++++++++++++-
net/http/mock_http_cache.cc | 56 +++++++++--
net/http/mock_http_cache.h | 38 +++++++-
5 files changed, 278 insertions(+), 17 deletions(-)

Upstream: git.chromium.org


  • Share