Repository navigation
fix: consume buffered final SIP responses after transaction completion - #923
benjamin-di wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #923 +/- ##
==========================================
+ Coverage 65.25% 70.42% +5.16%
==========================================
Files 51 46 -5
Lines 6588 9149 +2561
==========================================
+ Hits 4299 6443 +2144
- Misses 1915 2191 +276
- Partials 374 515 +141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Added the test-only follow-up in The focused race-enabled tests pass ten repeated runs, and |
e81d5e2 to
7c0255e
Compare
Reliable transports can close the transaction immediately after queuing a final response. When both channels are ready, preserve queued responses before reporting an incomplete transaction. Cover authentication challenges, success and rejection responses, and missing final responses.
Check empty and provisional-only open response channels after completion. Both must return the incomplete-transaction error without blocking and retain the response count. Bound the test and release its owned channel before reporting a timeout. Runtime behavior is unchanged.
7c0255e to
1eca7b4
Compare
On TCP/TLS, a client transaction can finish immediately after queuing a final response. If both
Done()andResponses()are ready,sipResponsecan select completion first and report an incomplete transaction despite a buffered final response. This also loses authentication challenges before a retry can be constructed.Drain queued responses when completion is observed, retaining normal cancellation and missing-final-response handling. Regressions cover buffered 200, 401, 403 and 407 responses after a provisional response, plus completion without a final response when the response channel is either closed or still open. The open-channel cases are bounded and release their owned channel on failure; they check that an incomplete transaction returns promptly and retains the provisional-response count.
Validation on upstream
1df341eplus this patch: focused race-enabled tests repeated ten times;go test -race -coverprofile=coverage.out ./pkg/...passed.sipResponsehas 100% local statement coverage, including the previously untested completion-with-empty-open-channel return. Replacing the nonblocking drain with a blocking receive makes both new cases fail within their watchdog, without a race or global test timeout. The original buffered-final regression fails on the unchanged stable implementation and passes with the fix.The latest commit is a test-only follow-up. The runtime patch carries no transport/configuration changes and adds no dial retries.
Rebase validation (2026-10-30)
Rebased onto
ffd1a64b1755; current head7c0255e79b00.go test -race ./pkg/...passes on this head. No live SIP call was made.Rebase validation (2026-10-31)
Rebased onto
mainate73272dedf3b; current head1eca7b475a7d.The complete
go test -race ./pkg/...suite andgit diff --checkpass. No live SIP call or separate integration fixture was run after this rebase.