Closed Bug 2030336 Opened 3 months ago Closed 3 months ago

HappyEyeballsConnectionAttempt::Claim() can strand transactions when another attempt wins

Categories

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

defect

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: kershaw, Assigned: kershaw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files, 1 obsolete file)

When HappyEyeballsConnectionAttempt::Claim() replaces the NullTransaction with a real nsHttpTransaction, the transaction is removed from the pending queue. If another HE attempt for the same ConnectionEntry wins the connection race (e.g., via H2 coalescing triggering MakeAllDontReuseExcept -> CloseAllConnectionAttempts), the losing attempt is abandoned.
The claimed transaction is never closed or requeued.

Keep the same behavior as DnsAndConnectSocket::Claim: reset speculative flags, but leave the real transaction in the pending queue. This avoids orphaning the transaction when another happy eyeballs attempt wins the connection race and the losing attempt is abandoned.

Update test_happy_eyeballs_timings.js, since the real transaction no longer observes connection-phase transport statuses from the speculative phase.

Attachment #9567728 - Attachment is obsolete: true

The previous fix for the crash in Http3Session::AddStream is not completely correct.
For H1/H2, we should skip the check so the transaction receives the connection and gets the proper error code (e.g., certificate verification failure). CanReuse on fresh H1 connections can also return false negatives when mKeepAlive is unset.
For H3, we should keep the CanReuse check to guard against sessions being destroyed between the async handshake callback and FinishInternal.

Attachment #9568743 - Attachment description: Bug Bug 2030336 - Requeue claimed transactions when H2 coalescing abandons HE attempts, r=mxinden → Bug 2030336 - Requeue claimed transactions when H2 coalescing abandons HE attempts, r=mxinden
Pushed by kjang@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/37993a983e98 https://hg.mozilla.org/integration/autoland/rev/bc8fa0ed1110 Only check CanReuse for H2/H3 in ConnectionEstablisher::FinishInternal, r=mxinden https://github.com/mozilla-firefox/firefox/commit/7a890251695e https://hg.mozilla.org/integration/autoland/rev/9334bd54589e Requeue claimed transactions when H2 coalescing abandons HE attempts, r=mxinden,necko-reviewers,valentin

Backed out for causing wpt failures @binaryType-wrong-value.any.html.

Pushed by kjang@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/03274a4ed83c https://hg.mozilla.org/integration/autoland/rev/19894daef11b Only check CanReuse for H2/H3 in ConnectionEstablisher::FinishInternal, r=mxinden https://github.com/mozilla-firefox/firefox/commit/85652ba50ae3 https://hg.mozilla.org/integration/autoland/rev/c6105b7a5c00 Requeue claimed transactions when H2 coalescing abandons HE attempts, r=mxinden,necko-reviewers,valentin
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: