Skip to content

Commit

Permalink
fix: trigger reconnection on INTERNAL status error (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarowolfx authored Apr 10, 2024
1 parent 0ba5b7d commit f555322
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions system-test/managed_writer_client_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f555322

Please sign in to comment.