Repository navigation
Conversation
ServerTx.Respond spun the FSM, let fsmMu go, and then read the error with tx.Err(). Timer J is zero on reliable transports, so the time.AfterFunc armed in actFinal is runnable at once; when it took fsmMu in that gap it drove the transaction to Terminated, and Respond returned ErrTransactionTerminated for a response already written to the connection. Read the error under the same lock as the spin. The timer goroutine then waits for that lock, so it can no longer change the result of a Respond that succeeded. Seen on a 10k-subscriber SIP soak over TCP: callers answering PRACK and UPDATE treated the error as a failed send and tore down established dialogs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ServerTx.Respondspins the FSM, releasesfsmMu, then reads the error withtx.Err(). Timer J is zero on reliable transports, so thetime.AfterFuncarmed inactFinalis runnable at once — if it takesfsmMuin that gap it drives the transaction to Terminated, andRespondreturnsErrTransactionTerminatedfor a response already written to the connection.Reading the error under the same lock as the spin closes the gap. The timer goroutine then waits for that lock and can no longer change the result of a
Respondthat succeeded.Found on a 10k-subscriber SIP soak over TCP: callers answering PRACK and UPDATE treated the error as a failed send and tore down established dialogs.
The test runs 150 rounds, with retransmissions keeping
fsmMucontended so it hands off to the waiting timer goroutine rather than lettingRespondreacquire. It fails reliably on main.