From e3106b99ca9fcebf8db9eedf9cc2a044d82f551c Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Wed, 12 May 2021 14:38:02 -0700 Subject: [PATCH] Don't query the config selector for calls that have ended --- packages/grpc-js/src/channel.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/grpc-js/src/channel.ts b/packages/grpc-js/src/channel.ts index 88b1d499..8b2658f3 100644 --- a/packages/grpc-js/src/channel.ts +++ b/packages/grpc-js/src/channel.ts @@ -509,6 +509,11 @@ export class ChannelImplementation implements Channel { } private tryGetConfig(stream: Http2CallStream, metadata: Metadata) { + if (stream.getStatus() !== null) { + /* If the stream has a status, it has already finished and we don't need + * to take any more actions on it. */ + return; + } if (this.configSelector === null) { /* This branch will only be taken at the beginning of the channel's life, * before the resolver ever returns a result. So, the