fix: register dialog state read channel before sending 200 OK#285
Merged
emiago merged 1 commit intoemiago:mainfrom Feb 2, 2026
Merged
fix: register dialog state read channel before sending 200 OK#285emiago merged 1 commit intoemiago:mainfrom
emiago merged 1 commit intoemiago:mainfrom
Conversation
This patch addresses a race where the 200 OK would be retransmitted forever because the ACK arrived before we started waiting for dialog state changes. The easiest way to reproduce this is to either produce lots of load and get lucky, or introduce a short sleep after sending the 200 OK, causing it to be retransmitted forever (and eventually return an error after a timeout): ```diff diff --git a/dialog_server.go b/dialog_server.go index e9b3a0e..03067f9 100644 --- a/dialog_server.go +++ b/dialog_server.go @@ -314,6 +314,8 @@ func (s *DialogServerSession) WriteResponse(res *sip.Response) error { return err } + time.Sleep(10 * time.Millisecond) + // Wait now for ACK for our 2xx // https://datatracker.ietf.org/doc/html/rfc3261#section-13.3.1.4 ```
Owner
|
Nice! 👍 |
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.
This patch addresses a race where the 200 OK would be retransmitted forever because the ACK arrived before we started waiting for dialog state changes.
The easiest way to reproduce this is to either produce lots of load and get lucky, or introduce a short sleep after sending the 200 OK, causing it to be retransmitted forever (and eventually return an error after a timeout):