From 95516b66a089fbce15dedfcd30d263f6fa5687ef Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Wed, 16 Nov 2022 14:37:31 -0800 Subject: [PATCH] Fix detection of refused streams --- packages/grpc-js/src/load-balancing-call.ts | 2 +- packages/grpc-js/src/retrying-call.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grpc-js/src/load-balancing-call.ts b/packages/grpc-js/src/load-balancing-call.ts index a7af83d6..48aaf48a 100644 --- a/packages/grpc-js/src/load-balancing-call.ts +++ b/packages/grpc-js/src/load-balancing-call.ts @@ -159,7 +159,7 @@ export class LoadBalancingCall implements Call { }, onReceiveStatus: status => { this.trace('Received status'); - if (status.code === http2.constants.NGHTTP2_REFUSED_STREAM) { + if (status.rstCode === http2.constants.NGHTTP2_REFUSED_STREAM) { this.outputStatus(status, 'REFUSED'); } else { this.outputStatus(status, 'PROCESSED'); diff --git a/packages/grpc-js/src/retrying-call.ts b/packages/grpc-js/src/retrying-call.ts index 71dedd46..a85fac67 100644 --- a/packages/grpc-js/src/retrying-call.ts +++ b/packages/grpc-js/src/retrying-call.ts @@ -385,7 +385,7 @@ export class RetryingCall implements Call { if (this.underlyingCalls[callIndex].state === 'COMPLETED') { return; } - this.trace('state=' + this.state + ' handling status from child [' + this.underlyingCalls[callIndex].call.getCallNumber() + '] in state ' + this.underlyingCalls[callIndex].state); + this.trace('state=' + this.state + ' handling status with progress ' + status.progress + ' from child [' + this.underlyingCalls[callIndex].call.getCallNumber() + '] in state ' + this.underlyingCalls[callIndex].state); this.underlyingCalls[callIndex].state = 'COMPLETED'; if (status.code === Status.OK) { this.retryThrottler?.addCallSucceeded();