From 848e00e54c070bebc410ed285703a5041b5d7d70 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Mon, 2 Dec 2024 15:14:40 -0500 Subject: [PATCH] grpc-js: Restore socket disconnect handling --- packages/grpc-js/package.json | 2 +- packages/grpc-js/src/transport.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/grpc-js/package.json b/packages/grpc-js/package.json index 46dc7efd7..fd8dd7abf 100644 --- a/packages/grpc-js/package.json +++ b/packages/grpc-js/package.json @@ -1,6 +1,6 @@ { "name": "@grpc/grpc-js", - "version": "1.12.2", + "version": "1.12.3", "description": "gRPC Library for Node - pure JS implementation", "homepage": "https://grpc.io/", "repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js", diff --git a/packages/grpc-js/src/transport.ts b/packages/grpc-js/src/transport.ts index 063fc86d9..7a82fd3cc 100644 --- a/packages/grpc-js/src/transport.ts +++ b/packages/grpc-js/src/transport.ts @@ -227,6 +227,11 @@ class Http2Transport implements Transport { this.handleDisconnect(); }); + session.socket.once('close', () => { + this.trace('connection closed'); + this.handleDisconnect(); + }); + if (logging.isTracerEnabled(TRACER_NAME)) { session.on('remoteSettings', (settings: http2.Settings) => { this.trace(