Closed
Bug 938186
Opened 12 years ago
Closed 11 years ago
HTTP cache v2: introduce DISALLOW_SYNC_CALLBACK for opening cache entries
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: mayhemer, Assigned: jdm)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
After some review discussion with Michal, it seems like a good idea to prevent the unexpected synchronous call of the open callback when using the new cache backend (i.e. onCacheEntryCheck and onCacheEntryAvailable can be called sooner then respective asyncOpenURI exits).
I can imagine extension developers will be introducing hacks like isInAsyncOpenURI flags etc.
Wisdom is at the place here.
Deps on bug 922741, which introduces a base code to easily play with the callback management and threading.
![]() |
Reporter | |
Comment 1•12 years ago
|
||
[ No longer blocks enabling cache2, expected to be fixed after cache2 is on ]
Blocks: cache2afterenable
![]() |
Reporter | |
Updated•12 years ago
|
No longer blocks: cache2enable
![]() |
Reporter | |
Updated•12 years ago
|
Blocks: cache2enable
![]() |
Reporter | |
Updated•12 years ago
|
No longer blocks: cache2enable
![]() |
Reporter | |
Updated•12 years ago
|
Blocks: cache2enable
![]() |
Reporter | |
Updated•12 years ago
|
No longer blocks: cache2enable
![]() |
Reporter | |
Comment 2•11 years ago
|
||
- looks big, but is actually quite simple
- two tests to 1) check the existing test (01-basic) scenario still works and 2) that the sync nature is not broken
- not changing the iid since there is no need when only adding a flag
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #8433660 -
Flags: review?(michal.novotny)
Comment 3•11 years ago
|
||
Comment on attachment 8433660 [details] [diff] [review]
v1
Review of attachment 8433660 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/cache2/nsICacheStorage.idl
@@ +50,5 @@
> */
> const uint32_t CHECK_MULTITHREADED = 1 << 4;
>
> /**
> + * Forces the callback to invoke always only asynchronously regardless we have
to be invoked
@@ +51,5 @@
> const uint32_t CHECK_MULTITHREADED = 1 << 4;
>
> /**
> + * Forces the callback to invoke always only asynchronously regardless we have
> + * all the information to invoked directly from inside asyncOpenURI method.
to invoke it directly
Attachment #8433660 -
Flags: review?(michal.novotny) → review+
![]() |
Reporter | |
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Backed out for xpcshell failures.
https://hg.mozilla.org/integration/mozilla-inbound/rev/b0dbdb35eace
https://tbpl.mozilla.org/php/getParsedLog.php?id=41129773&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=41128719&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=41129570&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=41129856&tree=Mozilla-Inbound
![]() |
Reporter | |
Updated•11 years ago
|
Attachment #8433660 -
Flags: review+
![]() |
Reporter | |
Comment 6•11 years ago
|
||
Theory:
- the writer (the first callbacks) is released by gc between return from most nested asyncOpenCacheEntry callback function and assignment outOfAsyncOpen3 = true;
- this means that we invoke the callback intended to be reposted during call of OnHandleClosed with aHandle == mWriter which synchronously calls InvokeCallbacks
- the dispatch of InvokeCallbacksLock is then just a no-op
![]() |
Reporter | |
Comment 7•11 years ago
|
||
- introduced mDispatchingCallbacks flag set between redispatch of InvokeCallbacks and actual fire on the target thread
- this way any sudden call to InvokeCallback(s) does nothing so that the condition of asynchronicity is 100% fulfilled
- not using the existing mPreventCallbacks flag since that is used for a different purpose and could well collide with the dispatch-wait purpose
- force async check removed from InvokeAvailableCallback (actually from OnAvailThread) since it's not needed, each callback must pass the InvokeCallbacks/InvokeCallback path
- patch is actually simpler then the one before
https://tbpl.mozilla.org/?tree=Try&rev=4b718272e9c6
Attachment #8433660 -
Attachment is obsolete: true
Attachment #8436369 -
Flags: review?(michal.novotny)
![]() |
Reporter | |
Comment 8•11 years ago
|
||
retry on a greened push:
https://tbpl.mozilla.org/?tree=Try&rev=8d22bc9bc311
![]() |
Reporter | |
Comment 9•11 years ago
|
||
(In reply to Honza Bambas (:mayhemer) from comment #8)
> retry on a greened push:
> https://tbpl.mozilla.org/?tree=Try&rev=8d22bc9bc311
Grrr... bug 1005696!
Landing now.
Updated•11 years ago
|
Attachment #8436369 -
Flags: review?(michal.novotny) → review+
![]() |
Reporter | |
Comment 10•11 years ago
|
||
![]() |
Reporter | |
Comment 11•11 years ago
|
||
Backed out https://hg.mozilla.org/integration/mozilla-inbound/rev/08974ed00874
The flag here is not of help (but it should be there anyway), I believe this a thread safety of the flags. I also tried to push with mForceAsync being a normal bool (not a bit) and no orange... So, the flags access needs careful check probably. There is some thread race condition!
![]() |
Reporter | |
Comment 12•11 years ago
|
||
OK, checked for thread races, all the time we access flags for write (and read of the new flag) under the lock. I'm getting out of ideas here, will try to get logging from try, however I cannot reproduce on try with an exactly the same patch as is on m-i... Really strange.
Also, since there is no big pressure on fixing add-ons (there is none that needs to migrate to cache1 actually!) I vote for postponing this bug or even WONTFIXING it.
![]() |
Reporter | |
Comment 13•11 years ago
|
||
(In reply to Honza Bambas (:mayhemer) from comment #12)
> to cache1
cache2 of course...
![]() |
Reporter | |
Comment 14•11 years ago
|
||
Closing, since no one complains - the patch is actually not needed.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Assignee | ||
Comment 15•11 years ago
|
||
Here's a rebased version.
Assignee | ||
Updated•11 years ago
|
Attachment #8436369 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Assignee: honzab.moz → josh
Assignee | ||
Comment 16•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•