Closed Bug 1802471 Opened 1 year ago Closed 1 year ago

Verify if we can bail out earlier from nsHttpChannel::BeginConnect in case of shutdown

Categories

(Core :: Networking: HTTP, task, P2)

task

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jstutte, Assigned: jstutte)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

In bug 1768581 we've seen that a late creation after net-teardown of an HTTP channel can lead to an unnecessary initialization of the cookie DB (and who knows what else) before it actually refuses to work.

The very beginning of nsHttpChannel::BeginConnect might be the right place to add an AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown) check and bail out with an error in case (which?).

Summary: Verifyx if we can bail out earlier from nsHttpChannel::BeginConnect in case of shutdown → Verify if we can bail out earlier from nsHttpChannel::BeginConnect in case of shutdown

(In reply to Jens Stutte [:jstutte] from comment #0)

In bug 1768581 we've seen that a late creation after net-teardown of an HTTP channel can lead to an unnecessary initialization of the cookie DB (and who knows what else) before it actually refuses to work.

The very beginning of nsHttpChannel::BeginConnect might be the right place to add an AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown) check and bail out with an error in case (which?).

I think we can check gHttpHandler->Active() before calling BeginConnect.

Ah, sure, that might work as well. There is a slight difference in time, AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown) triggers as soon as we enter that shutdown phase, while gHttpHandler->Active() is flipped as consequence of the net-teardown notification. I assume that there are not many listeners to net-teardown, so the difference is probably neglect-able here and it seems wise to use your existing infrastructure for this.

First try push. There might be something to investigate...

Assignee: nobody → jstutte
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]

(In reply to Jens Stutte [:jstutte] from comment #3)

First try push. There might be something to investigate...

Just some intermittent failures, hopefully. I am curious about those WPT leaks in a service worker test, but might just land as is.

Pushed by jstutte@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7cb2bf89ee90
nsHttpChannel::MaybeResolveProxyAndBeginConnect should not call BeginConnect if the handler is not active. r=necko-reviewers,kershaw
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
See Also: → 1802910
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: