gecko-dev/netwerk/protocol
Junior Hsu ebecc62699 Bug 1633935 - P13 Avoid ODA message being processed when the channel is already failed, r=mayhemer,kershaw,necko-reviewers
One line fix with a bunch of explanation.

When we perform networking on the socket process, OnDataAvailable could be sent directly from socket process to child process.
Therefore, it could be racy with OnStartRequest which is from parent process to child process by nature.

This patch is to resolve the failure (cancel) by parent process.
For example, https://searchfox.org/mozilla-central/rev/027893497316897b8f292bde48dbb6da2391a331/netwerk/protocol/http/nsHttpChannel.cpp#2713

Bug 1641496 introduce a status check to avoid ODA message being process
[2] https://searchfox.org/mozilla-central/rev/027893497316897b8f292bde48dbb6da2391a331/netwerk/protocol/http/HttpBackgroundChannelChild.cpp#163-171

It prevents putting ODA to the channel event queue in child process.

However, this is based on that `OnStartRequest` already finished excution, which is usually true if OnStartRequest is sent via PHttpChannel.
https://searchfox.org/mozilla-central/rev/027893497316897b8f292bde48dbb6da2391a331/netwerk/protocol/http/HttpChannelChild.cpp#417-422
ChannelEventQueue::RunOrEnque simply runs the OnStartRequest given there on the same thread and the queue is empty, since no blocking events from different thread are before OnStartRequest.

Now we are moving the next chapter. OnStartRequest is queued given we want to switch thread.
The failure status, which is initiated in parent process, is set in HttpChannelChild::OnStartRequest which could be later than the status check [2]

Therefore, we need another check to prevent ODA, which is already in the event queue, being processed.
We intentionally keep [2] for performance.

Differential Revision: https://phabricator.services.mozilla.com/D79771
2020-06-23 17:02:55 +00:00
..
about Bug 1574991 - Remove "In Browser Element" from about:cache.r=baku 2020-04-14 16:45:22 +00:00
data Bug 1590762 - Part 2: Bump the id for channel registration to uint64_t. r=mattwoodrow,necko-reviewers,valentin 2020-06-23 13:18:56 +00:00
file Bug 1590762 - Part 2: Bump the id for channel registration to uint64_t. r=mattwoodrow,necko-reviewers,valentin 2020-06-23 13:18:56 +00:00
ftp Bug 1590762 - Part 2: Bump the id for channel registration to uint64_t. r=mattwoodrow,necko-reviewers,valentin 2020-06-23 13:18:56 +00:00
gio Bug 1620594 - Part 1: Rework NS_ReleaseOnMainThreadSystemGroup. r=nika 2020-04-07 15:16:23 +00:00
http Bug 1633935 - P13 Avoid ODA message being processed when the channel is already failed, r=mayhemer,kershaw,necko-reviewers 2020-06-23 17:02:55 +00:00
res Bug 1630511 - Replace MOZ_MUST_USE with [[nodiscard]] in netwerk. r=necko-reviewers,dragana 2020-04-18 06:37:32 +00:00
viewsource Bug 1638513 - P3 strip request body header for preflight, r=valentin,necko-reviewers 2020-06-09 18:38:50 +00:00
websocket Backed out changeset 5614bcd268d1 (bug 1337953) for bustage at FuzzyLayer.cpp. CLOSED TREE 2020-06-23 11:01:37 +03:00
moz.build