Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);

Copy link
Copy Markdown
Member

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.

int batchSize = config.getBatchSize() == null ? 1 : config.getBatchSize();
return new SegmentLoadingCapabilities(batchSize, batchSize);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.

}
}

Expand Down