Skip to content

Commit

Permalink
fix: destroy internal grpc conn when closed (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarowolfx authored Apr 15, 2024
1 parent f555322 commit e7731bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/managedwriter/stream_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export class StreamConnection extends EventEmitter {
}
this._connection.end();
this._connection.removeAllListeners();
this._connection.destroy();
this._connection = null;
}

Expand Down
2 changes: 2 additions & 0 deletions system-test/managed_writer_client_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ describe('managedwriter.WriterClient', () => {
destinationTable: parent,
});
const connection = await client.createStreamConnection({streamId});
const internalConn = connection['_connection']!;
const writer = new Writer({
connection,
protoDescriptor,
Expand All @@ -1284,6 +1285,7 @@ describe('managedwriter.WriterClient', () => {
writer.close();
client.close();
assert.strictEqual(client.isOpen(), false);
assert.strictEqual(internalConn.destroyed, true);
} finally {
client.close();
}
Expand Down

0 comments on commit e7731bf

Please sign in to comment.