Skip to content

ServiceClient: More robust redirect handling.#13413

Merged
kfaraz merged 2 commits intoapache:masterfrom
gianm:rpc-redirect-loop
Nov 28, 2022
Merged

ServiceClient: More robust redirect handling.#13413
kfaraz merged 2 commits intoapache:masterfrom
gianm:rpc-redirect-loop

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Nov 22, 2022

Detects self-redirects, redirect loops, long redirect chains, and redirects to unknown servers. Treat all of these cases as an unavailable service, retrying if the retry policy allows it.

Previously, some of these cases would lead to a prompt, unretryable error. This caused clients contacting an Overlord during a leader change to fail with error messages like:

  org.apache.druid.rpc.RpcException: Service [overlord] redirected too many times

Additionally, a slight refactor of callbacks in ServiceClientImpl improves readability of the flow through onSuccess.

Detects self-redirects, redirect loops, long redirect chains, and redirects
to unknown servers. Treat all of these cases as an unavailable service,
retrying if the retry policy allows it.

Previously, some of these cases would lead to a prompt, unretryable error. This
caused clients contacting an Overlord during a leader change to fail with error
messages like:

  org.apache.druid.rpc.RpcException: Service [overlord] redirected too many times

Additionally, a slight refactor of callbacks in ServiceClientImpl improves
readability of the flow through onSuccess.
@gianm gianm added the Bug label Nov 22, 2022
Copy link
Copy Markdown
Contributor

@cryptoe cryptoe left a comment

Choose a reason for hiding this comment

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

LGTM!!

@cryptoe cryptoe added this to the 25.0 milestone Nov 22, 2022
@kfaraz kfaraz merged commit 58c896e into apache:master Nov 28, 2022
kfaraz pushed a commit to kfaraz/druid that referenced this pull request Nov 28, 2022
Detects self-redirects, redirect loops, long redirect chains, and redirects to unknown servers.
Treat all of these cases as an unavailable service, retrying if the retry policy allows it.

Previously, some of these cases would lead to a prompt, unretryable error. This caused
clients contacting an Overlord during a leader change to fail with error messages like:

org.apache.druid.rpc.RpcException: Service [overlord] redirected too many times

Additionally, a slight refactor of callbacks in ServiceClientImpl improves readability of
the flow through onSuccess.
abhishekagarwal87 pushed a commit that referenced this pull request Nov 30, 2022
Detects self-redirects, redirect loops, long redirect chains, and redirects to unknown servers.
Treat all of these cases as an unavailable service, retrying if the retry policy allows it.

Previously, some of these cases would lead to a prompt, unretryable error. This caused
clients contacting an Overlord during a leader change to fail with error messages like:

org.apache.druid.rpc.RpcException: Service [overlord] redirected too many times

Additionally, a slight refactor of callbacks in ServiceClientImpl improves readability of
the flow through onSuccess.

Co-authored-by: Gian Merlino <gianmerlino@gmail.com>
@gianm gianm deleted the rpc-redirect-loop branch November 30, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants