Skip to content

fix: create a server transaction outside the store's lock - #366

Closed
fridokus wants to merge 1 commit into
emiago:mainfrom
fridokus:servertx-lock
Closed

fridokus wants to merge 1 commit into
emiago:mainfrom
fridokus:servertx-lock

Conversation

@fridokus

Copy link
Copy Markdown

serverTxRequest holds the transaction store's write lock across serverTxCreate, which acquires the connection the responses will ride. When the connection the request arrived on is already gone, that is a dial to the Via host — and to a peer that has gone away it lasts the whole connect timeout, under a lock every request the layer receives waits on.

The requests queued behind it time out at their senders, whose closed connections make them the next dials, so the server side doesn't recover: INVITE forwarding fails at Timer B, REGISTERs go unanswered, and the subscribers those belonged to deregister.

Create the transaction unlocked and insert it under the lock, settling a retransmission that raced its copy in first in the winner's favour.

Seen on a 10,000-UE IMS bed: two of four proxies were down for two hours.

The test pins a dial open and checks an unrelated request still gets through; it fails on main after 2s.

serverTxRequest held the transaction store's write lock across
serverTxCreate, which acquires the connection the responses will ride.
When the connection the request arrived on is already gone that is a
dial to the Via host, and to a peer that has gone away it lasts the
whole connect timeout — under a lock every request the layer receives
waits on.

The requests queued behind it then time out at their senders, whose
closed connections make them the next dials, so the server side does
not recover: INVITE forwarding fails at Timer B, REGISTERs go
unanswered, and the subscribers those belonged to deregister.

Create the transaction unlocked and insert it under the lock, with a
retransmission that raced its copy in first settled in the winner's
favour.

Seen on a 10,000-UE IMS bed: two of four P-CSCFs were down for two
hours.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@fridokus

fridokus commented Oct 5, 2026

Copy link
Copy Markdown
Author

Closing: superseded by 86ec9f7 (#363) on main.

@fridokus fridokus closed this Oct 5, 2026
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.

1 participant