Repository navigation
sip: TestOriginateHoldRelayed waits for the callee's answer - #400
Merged
Merged
Conversation
…s re-INVITE The test took the destination phone's server dialog as soon as onInvite recorded it and sent a hold re-INVITE on it, while the callee function could still be writing the 200 (sipgo sets Dialog.InviteResponse in WriteResponse and reads it in buildReq): a data race under -race (CI run 44014233188). The test phone now closes a per-Call-ID channel when its callee function returns, and answeredDialog waits for it before handing the dialog out.
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.
TestOriginateHoldRelayed sent a hold re-INVITE on the destination phone's server dialog while the test phone's callee function could still be writing its 200 OK. sipgo writes Dialog.InviteResponse in WriteResponse and reads it in buildReq, so the race detector failed the test in CI run 44014233188 on PR #395.
The test phone now closes a channel for each Call-ID once its callee function returns. The new answeredDialog waits on that channel before it hands the dialog to the test. Locally, TestOriginateHoldRelayed passes 30 runs under -race, and the full internal/sip package passes under -race.