-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: Make HttpLoadQueuePeon degrade gracefully instead of throwing on fetch failure #20128
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,7 +178,13 @@ private SegmentLoadingCapabilities fetchSegmentLoadingCapabilities() | |
| return defaultCapabilities; | ||
| } else if (HttpServletResponse.SC_OK != responseHandler.getStatus()) { | ||
| log.makeAlert("Received status[%s] when fetching loading capabilities from server[%s]", responseHandler.getStatus(), serverId); | ||
| throw new RE("Received status[%s] when fetching loading capabilities from server[%s]", responseHandler.getStatus(), serverId); | ||
| int batchSize = config.getBatchSize() == null ? 1 : config.getBatchSize(); | ||
| SegmentLoadingCapabilities defaultCapabilities = new SegmentLoadingCapabilities(batchSize, batchSize); | ||
| log.warn( | ||
| "Failed to fetch loading capabilities from server[%s]. Received status[%s]. Using default capabilities[%s].", | ||
| serverId, responseHandler.getStatus(), defaultCapabilities | ||
| ); | ||
| return defaultCapabilities; | ||
| } | ||
|
|
||
| return jsonMapper.readValue( | ||
|
|
@@ -187,7 +193,9 @@ private SegmentLoadingCapabilities fetchSegmentLoadingCapabilities() | |
| ); | ||
| } | ||
| catch (Throwable th) { | ||
| throw new RE(th, "Received error while fetching historical capabilities from Server[%s].", serverId); | ||
| log.warn(th, "Failed to fetch loading capabilities from server[%s]. Using default capabilities.", serverId); | ||
| int batchSize = config.getBatchSize() == null ? 1 : config.getBatchSize(); | ||
| return new SegmentLoadingCapabilities(batchSize, batchSize); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Transient failures permanently throttle the peon serverCapabilities is initialized once and cached for the peon's lifetime. After a temporary timeout, 5xx, or malformed response, the stored fallback remains active indefinitely; with no configured batchSize this reduces normal and turbo loading to one segment per batch. Retry capability discovery or refresh the fallback. |
||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Fallback swallows fatal and interruption signals
The Throwable catch now converts fatal Errors and InterruptedException into a normal peon. This can mask JVM-level failures and clear interruption without restoring the thread flag. Catch only expected request/parsing exceptions, while rethrowing fatal errors and preserving interruption.