Skip to content

Commit 2b31f8c

Browse files
committed
grpc-js: Shutdown transport if a state change occurs while connecting
1 parent 442e3ea commit 2b31f8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/grpc-js/src/subchannel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ export class Subchannel {
245245
);
246246
}
247247
});
248+
} else {
249+
/* If we can't transition from CONNECTING to READY here, we will
250+
* not be using this transport, so release its resources. */
251+
transport.shutdown();
248252
}
249253
},
250254
error => {

0 commit comments

Comments
 (0)