Open Bug 1554652 Opened 6 years ago Updated 2 years ago

Implement asynchronous opening of alternative output stream

Categories

(Core :: Networking: Cache, enhancement, P5)

enhancement

Tracking

()

Tracking Status
firefox69 --- affected

People

(Reporter: michal, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

nsICacheEntry::openAlternativeOutputStream fails if there is any input stream opened for already existing alternative data. Asynchronous version should wait until last input stream is closed and then provide output stream via a callback.

Honza: a few weeks ago you said to ni? you to get your attention. For context: this patch blocks bug 1487113, and thus all of wasm alt-data caching. Thanks!

Flags: needinfo?(honzab.moz)

I don't remember what exactly you need from me on this one, assigned to Michal.

Really just knowing how or who to get this bug fixed, so as to unblock bug 1487113.

Ah! I recall now :)) Yes, changing to P1 so we try to find an assignee soon, for this release.

Flags: needinfo?(honzab.moz)
Priority: P2 → P1

Any luck on finding an assignee?

Flags: needinfo?(honzab.moz)

Michal is an assignee.

Flags: needinfo?(honzab.moz)

as discussed, putting on :mayhemer's radar if he can get to it this cycle.

Flags: needinfo?(honzab.moz)
Assignee: michal.novotny → honzab.moz
Status: NEW → ASSIGNED
Flags: needinfo?(honzab.moz)

Luke I need some confirmations first. Is the place you call the API at [1] where mCacheInfo is obtained at [2] and it all happens on the content process? Does it end up at [3] on the parent process?

If it's all true then this is getting more complicated than Michal claimed and I may not have more time to work on this soon.

[1] https://searchfox.org/mozilla-central/rev/c8dba8c886609d0fdb8fae68bab865bf03f1165c/dom/script/ScriptLoader.cpp#2972
[2] https://searchfox.org/mozilla-central/rev/c8dba8c886609d0fdb8fae68bab865bf03f1165c/dom/script/ScriptLoadHandler.cpp#416
[3] https://searchfox.org/mozilla-central/rev/c8dba8c886609d0fdb8fae68bab865bf03f1165c/netwerk/ipc/NeckoParent.cpp#352

Flags: needinfo?(luke)

Comment on attachment 9089501 [details]
DRAFT: Bug 1554652 - Make nsICacheEntry.openAlternativeOutputStream return the output stream optionally asynchronously via a callback

Luke, please check if this is (in the direction of) what you want and give it some testing. I want to write an automated test too, but it will be some work.

Attachment #9089501 - Flags: feedback?(luke)

So for context: this bug is for fixing a pre-existing race condition that currently leads to a rare intermittent failure with the current usage of alt-data by the JS bytecode cache. However, the additional patches baku wrote in bug 1487113 make this race happen much more frequently in new tests, leading to the backout of his patches. (baku's patches are, in turn, prequisites for the wasm alt-data patches.)

I'm afraid I don't understand this area of the code to answer your questions, though. baku: do you know the answer to Honza's question in comment 8 and whether the approach in comment 10 is what is needed?

Flags: needinfo?(luke) → needinfo?(amarchesini)

So It's the two patches to apply and test with them?

D26731 Bug 1487113 - Use alt-data to cache stream-compiled WebAssembly modules (r=baku)
D27101 Bug 1487113 - Add pref javascript.options.wasm_caching (r=baku)

No, those are my dependent patches. baku's two patches are the ones that landed in bug 1487113 comment 78.

"Dependent" means that this bug has to be fixed to land them? Are the tests in those "dependent" patches utilize the required functionality and fail (intermitentntly) w/o it? I simply want a test env and the starting point (where to use the new async API, if anywhere) to finish this work.

To be clear: this bug has to be fixed to re-land bug 1487113 comment 78 which is needed to land my wasm caching patches. If you look at the backout comment (bug 1487113 comment 80), you can see which tests start failing with the bug 1487113 comment 78 patches, which I think you could use to test your patches in this bug.

Thanks, Luke.

Flags: needinfo?(amarchesini)

The think that blocks me here is that I need to find the place where the new/modified API is to be used and who is going to be the implementer of the callback. Then have a test to check this functionality actually works.

For baku to be able to re-land the patches in bug 1487113 comment 78, iiuc, the usage of nsICacheInfoChanel.openAlternativeOutputStream() that needs to be updated is the one in ScriptLoader.cpp, where your patch has "TODO": that site goes from intermittently failing to perma-failing with baku's patches. So if you can (1) fill in that TODO, (2) get a clean try run (specifically for the test failures in bug 1487113 comment 80), (3) land all these patches, then I'm good to go to land wasm caching. Make sense?

Flags: needinfo?(honzab.moz)

About status: I rebased the patches and pushed to try again - Thu, Oct 3, 15:41:48. I can reproduce the problems reported in Comment 80 of the blocked bug. My next step is to find out (with some added logging) what happens.

Flags: needinfo?(honzab.moz)

Bug 1487113 is now P3. Reflecting the priority here as well and dis-assigning myself. I will just update the patches that I rebased in bug 1487113.

Priority: P1 → P3
Assignee: honzab.moz → nobody
Status: ASSIGNED → NEW
Attachment #9089501 - Flags: feedback?(luke)
Flags: needinfo?(nhnguyen)
Flags: needinfo?(nhnguyen)

Blocked bug 1487113 bumped to P2, does that help with prioritizing this?

Ta in advance

Flags: needinfo?(nhnguyen)
Assignee: nobody → honzab.moz
Flags: needinfo?(nhnguyen)
Priority: P3 → P2

Try push results:

TEST-UNEXPECTED-FAIL | browser/components/newtab/test/browser/abouthomecache/browser_basic_endtoend.js | Uncaught exception - undefined - threw exception: [Exception... "Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIInputStream.available]" nsresult: "0x80470002 (NS_BASE_STREAM_CLOSED)" location: "JS frame :: chrome://mochitests/content/browser/browser/components/newtab/test/browser/abouthomecache/head.js ::

netwerk/test/unit_ipc/test_alt-data_stream_wrap.js times out because the input streams leak, bug 1653996.

Assignee: honzab.moz → nobody
Flags: needinfo?(dd.mozilla)
Flags: needinfo?(dd.mozilla)
Severity: normal → S3

This isn't blocking important work anymore.

Priority: P2 → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: