Skip to content


fix: fix typo in rst stream message (#1029)
Browse files Browse the repository at this point in the history
* fix: fix typo in rst stream message

* filter all errors with "rst stream" in it
  • Loading branch information
mutianf committed Oct 5, 2021
1 parent 0bb3754 commit 50e6860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -77,8 +77,9 @@ public void onComplete() {
private Throwable convertException(Throwable t) {
// Long lived connections sometimes are disconnected via an RST frame. This error is
// transient and should be retried.
if (t instanceof InternalException) {
if (t.getMessage() != null && t.getMessage().contains("Received Rst stream")) {
if (t instanceof InternalException && t.getMessage() != null) {
String error = t.getMessage().toLowerCase();
if (error.contains("rst_stream") || error.contains("rst stream")) {
return new InternalException(t, ((InternalException) t).getStatusCode(), true);
Expand Down
Expand Up @@ -270,7 +270,7 @@ public void retryRstStreamExceptionTest() {
new InternalException(
new StatusRuntimeException(
"HTTP/2 error code: INTERNAL_ERROR\nReceived Rst stream")),
"INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")),
Expand Down

0 comments on commit 50e6860

Please sign in to comment.