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

Return RetriableRequestException for Netty Max Active Stream error #1001

Merged
merged 6 commits into from
May 24, 2024

Conversation

xt-dev
Copy link
Contributor

@xt-dev xt-dev commented May 23, 2024

This change adds logic in HttpBridge to return RetriableRequestException rather than RemoteInvocationException when StreamException from Netty is returned with cause of Maximum active streams violated for this endpoint. This allows the downstream client - RetryClient to retry the request with different hosts when stream hits the maximum of a given host.

wc-test passed

{
StreamException streamException = (StreamException) responseError;
response = TransportResponseImpl.error(
new RetriableRequestException("Failed to get response from server for URI " + uri, streamException),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid duplicating the exception message?

RemoteInvocationException wrapException(String message, Throwable exception) {
  if (shouldReturnRetriableRequestException(exception)) {
    return new RetriableRequestException(message, exception);
  } else {
    return new RemoteInvocationException(message, exception);
  }
}

@xt-dev xt-dev marked this pull request as ready for review May 23, 2024 22:10
Copy link
Contributor

@shivamgupta1 shivamgupta1 left a comment

Choose a reason for hiding this comment

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

thanks

Copy link
Contributor

@TylerHorth TylerHorth left a comment

Choose a reason for hiding this comment

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

LGTM

@junchuanwang junchuanwang merged commit 63ba831 into linkedin:master May 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants