Skip to content

Commit 87202aa

Browse files
authored
Fix outbound retry root cause (#631)
1 parent 5bd3f50 commit 87202aa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/sip/outbound.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,9 @@ func sipResponse(ctx context.Context, tx sip.ClientTransaction, stop <-chan stru
499499
select {
500500
case <-ctx.Done():
501501
_ = tx.Cancel()
502-
return nil, psrpc.NewErrorf(psrpc.DeadlineExceeded, "sip request timed out")
502+
// NOTE: psrpc.Canceled does not auto-retry, whereas psrpc.DeadlineExceeded does
503+
// As long as that is the case, avoid psrpc.DeadlineExceeded to prevent hammering of destination.
504+
return nil, psrpc.NewErrorf(psrpc.Canceled, "sip request timed out")
503505
case <-stop:
504506
_ = tx.Cancel()
505507
return nil, psrpc.NewErrorf(psrpc.Canceled, "service shutting down")

0 commit comments

Comments
 (0)