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

[Backport 2.x] Fixed assignment to catch block parameter #16368

Merged
merged 1 commit into from
Oct 17, 2024
Merged
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
15 changes: 8 additions & 7 deletions server/src/main/java/org/opensearch/search/SearchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,15 @@
}
} catch (Exception e) {
// execution exception can happen while loading the cache, strip it
if (e instanceof ExecutionException) {
e = (e.getCause() == null || e.getCause() instanceof Exception)
? (Exception) e.getCause()
: new OpenSearchException(e.getCause());
Exception exception = e;
if (exception instanceof ExecutionException) {
exception = (exception.getCause() == null || exception.getCause() instanceof Exception)
? (Exception) exception.getCause()
: new OpenSearchException(exception.getCause());

Check warning on line 729 in server/src/main/java/org/opensearch/search/SearchService.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/search/SearchService.java#L728-L729

Added lines #L728 - L729 were not covered by tests
}
logger.trace("Query phase failed", e);
processFailure(readerContext, e);
throw e;
logger.trace("Query phase failed", exception);
processFailure(readerContext, exception);
throw exception;
} finally {
taskResourceTrackingService.writeTaskResourceUsage(task, clusterService.localNode().getId());
}
Expand Down
Loading