Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix typo in rst stream message #1029

Merged
merged 2 commits into from Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -78,7 +78,7 @@ 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.getMessage() != null && t.getMessage().contains("Received Rst Stream")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we use a case insensitive comparison?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just simplify this to lowercase().contains("rst_stream") || lowercase.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(
Status.INTERNAL.withDescription(
"HTTP/2 error code: INTERNAL_ERROR\nReceived Rst stream")),
"INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")),
GrpcStatusCode.of(Code.INTERNAL),
false);
service.expectations.add(
Expand Down