bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Consider closing phantom output stream under CacheEntry's lock before callbacks invocation.

RESOLVED DUPLICATE of bug 1154124

Status

()

Core
Networking: Cache
RESOLVED DUPLICATE of bug 1154124
4 years ago
2 years ago

People

(Reporter: mayhemer, Unassigned)

Tracking

(Blocks: 1 bug)

31 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-backlog])

(Reporter)

Description

4 years ago
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.
(Reporter)

Comment 1

4 years ago
Same for CacheEntry::SetValid()
(Reporter)

Updated

4 years ago
Blocks: 1035490
Whiteboard: [necko-backlog]
(Reporter)

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1154124
You need to log in before you can comment on or make changes to this bug.