When we hit the hash collision case in CreateOrFindActiveEntry:
https://cs.chromium.org/chromium/src/net/disk_cache/simple/simple_backend_impl.cc?rcl=5828a72d5f5d969ce71280572604f3439123c524&l=672
... we doom the old entry, which moves it active_entries_ -> entries_pending_doom_, and then re-try CreateOrFindActiveEntry which succeeds now the entry is not active. Trouble is, the I/O for the doom is asynchronously pending, so the actual creation op is likely to fail since the file is still there. It should probably rather append the creation op to the completion queue in entries_pending_doom_, the way the callers to CreateOrFindActiveEntry would if the entry was being doomed at entrance time.
One way of doing it would be to combine the doom + active checks in one function. Probably too rare to be a big deal, but it meshes with some
of the refactoring TODOs in the area --- pretty much impossible to test, though.
Comment 1 by bugdroid1@chromium.org
, Oct 2 2017