Closed Bug 1033461 Opened 6 years ago Closed 4 years ago
Consider closing phantom output stream under Cache
Entry's lock before callbacks invocation .
CacheEntry::OnHandleClosed closes the phantom output stream when it has not been taken (actually open) by the writer. But it happens a) after the next callback (consumer) in line has been invoked and b) outside the lock so that any other consumer could try opening the output stream before the phantom one has been closed (and more importantly - removed from the CacheFile.) That would lead to NS_ERROR_NOT_AVAILABLE being thrown and inability to cache the data. I don't see any chance for reentering the CacheEntry's code from CacheFile::OnOutputRemoved() - OnOutputClosed is redispatched - so it should be OK to close the output stream before callbacks and before leaving the lock.
Same for CacheEntry::SetValid()
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1154124
You need to log in before you can comment on or make changes to this bug.