Closed Bug 1666620 Opened 4 years ago Closed 4 years ago

Have to close the transaction if HttpConnectionUDP::Init() failed

Categories

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

defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: kershaw, Assigned: kershaw)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

I accidentally found that if we don't close the transaction when HttpConnectionUDP::Init returns an error, the transaction will be always stayed in the pending queue.

In details:

  1. A transaction is going to be dispatched to a h3 connection, so a new half open is created.
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp Creating nsHalfOpenSocket [this=0x110750580 trans=0x110717800 ent=test.h3.com key=.S......[tlsflags0x00000000]test.h3.com:443 <ROUTE-via www.h3.com:54168> {NPN-TOKEN h3-27}]
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp nsHalfOpenSocket::SetupStreams [this=0x110750580 ent=.S......[tlsflags0x00000000]test.h3.com:443 <ROUTE-via www.h3.com:54168> {NPN-TOKEN h3-27}] setup routed transport to origin test.h3.com:443 via www.h3.com:54168
  1. When HttpConnectionUDP::Init is failed, we returns an error code here. However, this error code is not handled in nsHttpConnectionMgr::nsHalfOpenSocket::OnOutputStreamReady.
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: E/nsHttp HttpConnectionUDP::Init this=0x10aaaafc0 sockettransport=0x1106da818
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp Http3Session::Http3Session [this=0x1106db000]
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: I/nsHttp Http3Session::Init 0x1106db000
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: D/nsSocketTransport nsSocketTransport::GetSelfAddr [this=0x1106da800 state=0] NOT_AVAILABLE because not yet connected.
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: I/nsHttp Http3Session::Init GetSelfAddr failed [this=0x1106db000]
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp HttpConnectionUDP::Init mHttp3Session->Init failed [this=0x10aaaafc0 rv=80004005]
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: D/nsSocketTransport nsSocketTransport::GetPeerAddr [this=0x1106da800 state=0] NOT_AVAILABLE because not yet connected.
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp nsHalfOpenSocket::SetupConn conn->init (0x10aaaafc0) failed 80004005
  1. The transaction is still in the pending queue and the half open is released.
 0:06.58 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp Destroying nsHalfOpenSocket [this=0x110750580]
  1. The transaction is dispatched again and a new half open created.
 0:06.72 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp Creating nsHalfOpenSocket [this=0x110750820 trans=0x110717800 ent=test.h3.com key=.S......[tlsflags0x00000000]test.h3.com:443 <ROUTE-via www.h3.com:54168> {NPN-TOKEN h3-27}]
 0:06.72 pid:53507 [(null) 53507: Socket Thread]: V/nsHttp nsHalfOpenSocket::SetupStreams [this=0x110750820 ent=.S......[tlsflags0x00000000]test.h3.com:443 <ROUTE-via www.h3.com:54168> {NPN-TOKEN h3-27}] setup routed transport to origin test.h3.com:443 via www.h3.com:54168
  1. HttpConnectionUDP::Init failed and we go to (1) again.

We should disable HTTP3 for the transaction and also add the domain to exclusion list by calling this function.

Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6322b86e1df4 Close the transaction when Http3Session::Init failed, r=dragana,necko-reviewers
Flags: needinfo?(kershaw)
Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7b84223112fd Close the transaction when Http3Session::Init failed, r=dragana,necko-reviewers
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: