Skip to content

sip: TestOriginateHoldRelayed waits for the callee's answer - #400

Merged
piwi3910 merged 2 commits into
mainfrom
fix/originate-hold-race
Nov 17, 2026
Merged

piwi3910 merged 2 commits into
mainfrom
fix/originate-hold-race

Conversation

@piwi3910

Copy link
Copy Markdown
Contributor

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.

…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.
@piwi3910
piwi3910 merged commit 0f4adae into main Nov 17, 2026
29 checks passed
@piwi3910
piwi3910 deleted the fix/originate-hold-race branch November 17, 2026 08:40
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