Skip to content

Commit 50e6860

Browse files
authored
fix: fix typo in rst stream message (#1029)
* fix: fix typo in rst stream message * filter all errors with "rst stream" in it
1 parent 0bb3754 commit 50e6860

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ public void onComplete() {
7777
private Throwable convertException(Throwable t) {
7878
// Long lived connections sometimes are disconnected via an RST frame. This error is
7979
// transient and should be retried.
80-
if (t instanceof InternalException) {
81-
if (t.getMessage() != null && t.getMessage().contains("Received Rst stream")) {
80+
if (t instanceof InternalException && t.getMessage() != null) {
81+
String error = t.getMessage().toLowerCase();
82+
if (error.contains("rst_stream") || error.contains("rst stream")) {
8283
return new InternalException(t, ((InternalException) t).getStatusCode(), true);
8384
}
8485
}

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public void retryRstStreamExceptionTest() {
270270
new InternalException(
271271
new StatusRuntimeException(
272272
Status.INTERNAL.withDescription(
273-
"HTTP/2 error code: INTERNAL_ERROR\nReceived Rst stream")),
273+
"INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")),
274274
GrpcStatusCode.of(Code.INTERNAL),
275275
false);
276276
service.expectations.add(

0 commit comments

Comments
 (0)