Establish the inner connection through an outer connection via Happy Eyeballs
Categories
(Core :: Networking, task, P2)
Tracking
()
People
(Reporter: kershaw, Assigned: kershaw)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(16 external files, 1 obsolete file)
Bug 2053088 handed the outer proxy connection to Happy Eyeballs, but the inner connection through the CONNECT tunnel is still established synchronously by the real transaction.
We'd like to race the tunnel endpoints (HTTP/3 against an HTTP/2 fallback) and publishes the first usable connection.
| Assignee | ||
Comment 1•2 months ago
|
||
Removing a stream from the session's queues left its queued flags set, so
StreamReadyToWrite silently refused to schedule it again and QueueStream would
assert: a CONNECT-UDP tunnel stream, which FinishTunnelSetup removes while the
inner connection still has datagrams waiting, then never sent them. Clear both
flags on removal, and drain a queue into a local array before putting streams
back, because popping can release a stream's last reference and that teardown
re-enters the removal with a half-rotated deque. Hold a reference to the
session across Close for the same reason.
| Assignee | ||
Comment 2•2 months ago
|
||
The inner session's first Initial is generated while the outer connection may
still be negotiating, and Http3Session::ProcessOutput treats a send failure as
fatal, so refusing the datagram tears down the connection that produced it.
Only fail once the stream is SEND_DONE and queue otherwise; OnProcessDatagram
flushes after activation.
Depends on D325811
| Assignee | ||
Comment 3•2 months ago
|
||
Http2StreamTunnel inherits nsISupports through both Http2StreamBase and
nsISocketTransport, and its interface map had no entry for it, so
NS_INTERFACE_MAP_END asserted on any QueryInterface for nsISupports. Resolve it
through Http2StreamBase to match the refcounting, and drop a duplicated
nsITransport entry.
Depends on D325812
| Assignee | ||
Comment 4•2 months ago
|
||
Http2StreamBase only moves bytes while the session holds its segment
reader/writer, so a consumer whose I/O lands after the OnSocketReady callback
returns -- anything copying through NS_AsyncCopy -- never makes progress and
spins the socket thread. Hold one chunk over in each direction so such a write
or read succeeds, and send or serve it from the next window.
Depends on D325813
| Assignee | ||
Comment 5•2 months ago
|
||
Move DefaultHappyEyeballsConnMgrDelegate into its own file, hoist the attempt
timer from HappyEyeballsConnectionAttempt into ConnectionAttempt, and extract
ConnectionAttemptPool::AdoptConnectionAttempt and
ConnectionEstablisher::HandsOverBareConnection. Also let a caller override
network.http.happy_eyeballs_connection_attempt_delay, which an inner connection
through a CONNECT tunnel needs. No behaviour change.
Depends on D325814
| Assignee | ||
Comment 6•2 months ago
|
||
An origin reached through a CONNECT proxy had its inner connection created
synchronously, with the real transaction driving the CONNECT: one endpoint, no
racing and no fallback. InnerConnectionAttempt runs a Happy Eyeballs machine of
its own over the tunnel, giving each endpoint an InnerConnectionEstablisher and
a TunnelSetupTransaction to own the CONNECT, and publishes the first usable
connection while the real transaction waits in the pending queue. Gated on
network.http.happy_eyeballs_tunnel_enabled.
Depends on D325815
| Assignee | ||
Comment 7•2 months ago
|
||
A connect-only channel wants the CONNECT'd tunnel itself, and through a
multiplexed proxy it never got one: the outer connection tore its own HTTP/2
session down before any tunnel existed, and the setup driver consumed the
CONNECT response the channel needs. Narrow the connect-only handling in
nsHttpConnection to the connection that issues the CONNECT and to the real
transaction, hand the response to that transaction, and stop driving I/O while
the consumer takes the transport over.
Depends on D325816
| Assignee | ||
Comment 8•2 months ago
|
||
An upgrade on an HTTP/2 inner connection has to become an extended CONNECT
stream, and dispatching it as a plain stream handed the consumer a session it
cannot take a transport from. Leave such a transaction pending once the
connection is published, so the entry's own dispatch places it -- that already
handles the peer's SETTINGS not having arrived and the fallback when extended
CONNECT turns out unsupported.
Depends on D325817
| Assignee | ||
Comment 9•2 months ago
|
||
RemoveStreamFromQueues took the stream out of mReadyForWrite and mQueuedStreams
but left mInTxQueue and mQueued set, so StreamReadyToWrite's early return
refused to schedule it ever again and QueueStream would assert. A CONNECT-UDP
tunnel stream hits this: FinishTunnelSetup removes it from the queues and keeps
it in mTunnelStreams, so the inner connection's queued datagrams were never
sent.
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 10•2 days ago
|
||
Closing an HTTP/3 tunnel stream or its UDP connection can re-enter and drop
the last reference to the object running the call. Hold the Http3Session in
HttpConnectionUDP::CloseTransaction and the transaction in
Http3TunnelStreamBase::WriteSegments, and make HandleTunnelResponse take an
nsAHttpTransaction, which is all it needs. No behavior change.
| Assignee | ||
Comment 11•2 days ago
|
||
It parses the CONNECT response itself, because NullHttpTransaction never does
and HandleTunnelResponse is only reached through OnHeadersAvailable. Nothing
uses it yet.
Depends on D346169
| Assignee | ||
Comment 12•2 days ago
|
||
Creates an inner connection tunnelled through an HTTP/2 or HTTP/3 outer
connection and driven by a TunnelSetupTransaction. For HTTP/3 it also lets the
caller learn when the inner QUIC handshake completes. Nothing calls it yet.
Depends on D346170
| Assignee | ||
Comment 13•2 days ago
|
||
The analogue of ConnectionEstablisher for an inner connection: it opens the
tunnel with CreateInnerConnection, lets a TunnelSetupTransaction run the
CONNECT, and reports success only once the connection is usable (CONNECT 200
plus the inner TLS or QUIC handshake). Nothing uses it yet.
Depends on D346171
| Assignee | ||
Comment 14•2 days ago
|
||
MakeAllDontReuseExcept closes every attempt of an entry to make room for a
connection that may itself still belong to one, and closing that attempt would
tear the connection down. ConnectionAttempt::OwnsConnection lets an attempt say
so; it defaults to false, so no existing attempt behaves differently.
Depends on D346172
| Assignee | ||
Comment 15•2 days ago
|
||
InnerConnectionAttempt runs a Happy Eyeballs machine of its own over the
tunnel, giving each endpoint an InnerConnectionEstablisher and a
TunnelSetupTransaction to own the CONNECT, and publishes the first usable
connection while the real transaction waits in the pending queue. The
connection manager does not start one yet.
Depends on D346173
| Assignee | ||
Comment 16•2 days ago
|
||
An origin reached through a CONNECT proxy now has its inner connection
established by an InnerConnectionAttempt instead of the real transaction driving
the CONNECT, with no racing and no fallback. Gated on
network.http.happy_eyeballs_tunnel_enabled, on by default in Nightly. Consumers
that take the tunnel themselves (connect-only, WebSocket, WebTransport) stay on
the old path.
Depends on D346174
| Assignee | ||
Comment 17•2 days ago
|
||
Depends on D346175
Description
•