Skip to content

Close a hosted xgress conn at once when its circuit never started - #1038

Open
plorenz wants to merge 2 commits into
mainfrom
fix.1036.hosted-xgress-prestart-close
Open

plorenz wants to merge 2 commits into
mainfrom
fix.1036.hosted-xgress-prestart-close

Conversation

@plorenz

@plorenz plorenz commented Oct 2, 2026

Copy link
Copy Markdown
Member

Fixes #1036.

An SDK-hosted xgress conn whose circuit never started blocked in Close until CircuitStartTimeout (three minutes), because PeerClosed sends its EOF into a terminator send buffer that only runs once the circuit starts. A refused dial never starts its circuit, so CompleteAcceptFailed followed by Close always hit this, stalling one-at-a-time accept loops such as the ziti tunneler's. close now closes the xgress outright when the circuit hasn't started.

Two things on the same path change with it. A conn the mux rejected as a duplicate id is dropped rather than closed, since its teardown would remove the live conn holding that id. Xgress.Close now bounds its end-of-circuit send, so a stalled router channel can't hold it. The circuit start timer also no longer warns about an xgress that is already closed.

The backport to release-v1.8.x is tracked in #1037.

 #1036

- closes the xgress outright from edgeConnXgress.close when the circuit has not started, since
  the EOF that PeerClosed sends waits on a send buffer that only runs once the circuit starts;
  Close after CompleteAcceptFailed, Close without completing the accept, and the setup-failure
  cleanup in newChildConnection now return at once instead of after CircuitStartTimeout
- drops a conn the mux rejected as a duplicate id instead of closing it, so its teardown no
  longer removes the live conn registered under that id
- bounds the end-of-circuit send in Xgress.Close with a deadline, so a stalled router channel
  cannot hold Close
- skips the circuit start timeout warning and close for an xgress that is already closed
- tests each path through newChildConnection with no circuit start, Close against a stalled data
  plane, and the start timer on a closed xgress; each test fails without its change
- adds #1036 to the 2.0.0 release notes, along with #1018, which the generator had not picked up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Closing an SDK-hosted xgress conn before its circuit starts blocks for the circuit start timeout

1 participant