Skip to content

fix(grpc-js): stop retry attempts after the call is cancelled - #3117

Merged
murgatroid99 merged 1 commit into
grpc:@grpc/grpc-js@1.14.xfrom
murgatroid99:grpc-js_retry_cancel_backoff_fix_1.14
Oct 28, 2026
Merged

murgatroid99 merged 1 commit into
grpc:@grpc/grpc-js@1.14.xfrom
murgatroid99:grpc-js_retry_cancel_backoff_fix_1.14

Conversation

@murgatroid99

Copy link
Copy Markdown
Member

Backport #3102 to 1.14.x

cancelWithStatus() reported the status and cancelled the child calls, but
left the retry state unchanged and the backoff timer running. When a call
was cancelled while a retry was waiting out its backoff, the timer still
started a new attempt, and the call kept retrying through its remaining
attempts after the application had cancelled it.

Those attempts are sent after reportStatus() has cleared the write buffer,
so a unary attempt carries headers but no message. The server never
responds, and the stream stays open until the connection closes, occupying
one of the server's concurrent streams. Enough of them block every new call
on the channel.

Track the retry timer, and on cancellation disable further attempts and
clear the retry and hedging timers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@murgatroid99
murgatroid99 merged commit 5f932bf into grpc:@grpc/grpc-js@1.14.x Oct 28, 2026
4 checks passed
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.

2 participants