Skip to content

Commit b8dc020

Browse files
authored
Merge pull request #2644 from murgatroid99/grpc-js_channelz_socket_connecting_handle_fix
grpc-js: Shutdown transport if a state change occurs while connecting
2 parents 442e3ea + 2b31f8c commit b8dc020

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)