Repository navigation
Read responses already passed up when a client transaction ends - #995
Open
jjaroztegi wants to merge 1 commit into
Open
jjaroztegi wants to merge 1 commit into
jjaroztegi wants to merge 1 commit into
Conversation
sipgo deletes a client transaction right after passing up its final response when Timer D is zero: always over TCP/TLS, and over UDP when the response arrives before Init sets the timer. Done is then closed with the response still buffered in Responses, and sipResponse's select picks Done about half of the time. The response is lost and the request is reported as "transaction failed to complete": a 407 challenge or a rejection to an outbound INVITE, or the 202 to a REFER. When Done fires, read the responses the transaction already passed up and return the final one, if any, before reporting a timeout. INVITE, BYE and REFER all wait in sipResponse.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #995 +/- ##
==========================================
+ Coverage 65.25% 71.65% +6.39%
==========================================
Files 51 47 -4
Lines 6588 9263 +2675
==========================================
+ Hits 4299 6637 +2338
- Misses 1915 2118 +203
- Partials 374 508 +134 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
An outbound INVITE over TCP/TLS can lose its non-2xx final response and fail with
transaction failed to complete (1 intermediate responses). When the lost response is a 407, the authenticated INVITE is never sent (#950). A REFER over UDP is reported failed withtransaction failed to complete (0 intermediate responses)in about 1 of 30-40 transfers, although the peer answered 202 and completed the transfer (#906).Cause: when Timer D is zero (always over TCP/TLS, and over UDP when the response arrives before
ClientTx.Init), sipgo deletes the transaction right after passing up the final response.DoneandResponsesare then both ready, and theselectinsipResponsepicksDoneabout half the time.Change: when
Donefires,sipResponsereturns a final response already waiting inResponsesbefore reporting a timeout. INVITE, BYE and REFER all wait there. This fixes #950, and the #906 symptom over any transport, independently of livekit/sipgo#18.Tested: new
TestSIPResponseAfterTransactionDonebuffers a 100 and a 407 with both channels closed, as sipgo leaves them, and fails without the change.golangci-lint runandgo test -race ./pkg/...pass.Fixes #950