Skip to content

Commit

Permalink
Make client robust to Rst from OkHTTP (#1358)
Browse files Browse the repository at this point in the history
The
[OKHTTP](https://github.com/grpc/grpc-java/blob/d4fa0ecc07495097453b0a2848765f076b9e714c/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java#L1241)
transport uses slightly different error messages for RST Stream that
aren't caught by current screen scraping.  This adds a check for the
strict explicitly.

bug: Retry RST Stream on OKHTTP.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
  • Loading branch information
emkornfield committed Oct 18, 2021
1 parent 3223551 commit 03f9d75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Expand Up @@ -74,6 +74,7 @@ public static boolean isRetryableInternalStatus(Status status) {
&& description != null
&& (description.contains("Received unexpected EOS ")
|| description.contains(" Rst ")
|| description.contains("Rst Stream")
|| description.contains("RST_STREAM")
|| description.contains("Connection closed with unknown cause")
|| description.contains("HTTP/2 error code: INTERNAL_ERROR"));
Expand Down
Expand Up @@ -42,6 +42,7 @@ public void testRetryableInternalForRstErrors() {
Errors.isRetryableInternalStatus(
Status.INTERNAL.withDescription(
"RST_STREAM closed stream. HTTP/2 error code: INTERNAL_ERROR")));
assertTrue(Errors.isRetryableInternalStatus(Status.INTERNAL.withDescription("Rst Stream")));
}

@Test
Expand Down

0 comments on commit 03f9d75

Please sign in to comment.