From f5553220b9b9fe5289f9a1c394d3f964c016f07d Mon Sep 17 00:00:00 2001 From: Alvaro Viebrantz Date: Wed, 10 Apr 2024 12:58:43 -0700 Subject: [PATCH] fix: trigger reconnection on INTERNAL status error (#435) --- src/managedwriter/stream_connection.ts | 1 + system-test/managed_writer_client_test.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/managedwriter/stream_connection.ts b/src/managedwriter/stream_connection.ts index 1a1e3b89..492bf258 100644 --- a/src/managedwriter/stream_connection.ts +++ b/src/managedwriter/stream_connection.ts @@ -139,6 +139,7 @@ export class StreamConnection extends EventEmitter { gax.Status.ABORTED, gax.Status.CANCELLED, gax.Status.DEADLINE_EXCEEDED, + gax.Status.INTERNAL, ]; return !!err.code && reconnectionErrorCodes.includes(err.code); } diff --git a/system-test/managed_writer_client_test.ts b/system-test/managed_writer_client_test.ts index 2b36deb5..77b03b69 100644 --- a/system-test/managed_writer_client_test.ts +++ b/system-test/managed_writer_client_test.ts @@ -1149,6 +1149,10 @@ describe('managedwriter.WriterClient', () => { code: gax.Status.DEADLINE_EXCEEDED, msg: 'a msg', }, + { + code: gax.Status.INTERNAL, + msg: 'received RST_STREAM with code', + }, ].map(err => { const gerr = new gax.GoogleError(err.msg); gerr.code = err.code;