-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix ActionListener.map exception handling #50886
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
Changes from 9 commits
09b5576
3087981
198651b
62eaedc
15e4199
2b24d57
0dae4f4
b62a2b7
65ba493
ca31964
084790e
534c2bc
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 |
|---|---|---|
|
|
@@ -55,7 +55,6 @@ | |
| import org.elasticsearch.transport.TransportService; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.UncheckedIOException; | ||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import java.util.function.BiFunction; | ||
|
|
@@ -306,27 +305,11 @@ public static void registerRequestHandler(TransportService transportService, Sea | |
| (in) -> TransportResponse.Empty.INSTANCE); | ||
|
|
||
| transportService.registerRequestHandler(DFS_ACTION_NAME, ThreadPool.Names.SAME, ShardSearchRequest::new, | ||
| (request, channel, task) -> { | ||
| searchService.executeDfsPhase(request, (SearchShardTask) task, new ActionListener<SearchPhaseResult>() { | ||
| @Override | ||
| public void onResponse(SearchPhaseResult searchPhaseResult) { | ||
| try { | ||
| channel.sendResponse(searchPhaseResult); | ||
| } catch (IOException e) { | ||
| throw new UncheckedIOException(e); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public void onFailure(Exception e) { | ||
| try { | ||
| channel.sendResponse(e); | ||
| } catch (IOException e1) { | ||
| throw new UncheckedIOException(e1); | ||
| } | ||
| } | ||
| }); | ||
| }); | ||
| (request, channel, task) -> | ||
| searchService.executeDfsPhase(request, (SearchShardTask) task, | ||
| new ChannelActionListener<>(channel, DFS_ACTION_NAME, request)) | ||
|
Contributor
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.
Contributor
Author
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. Yes, but the code used to propagate the exception out. This seemed to be a left-over from when the We should notice that So I would like to keep using
Contributor
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. ++ |
||
| ); | ||
|
|
||
| TransportActionProxy.registerProxyAction(transportService, DFS_ACTION_NAME, DfsSearchResult::new); | ||
|
|
||
| transportService.registerRequestHandler(QUERY_ACTION_NAME, ThreadPool.Names.SAME, ShardSearchRequest::new, | ||
|
|
||
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.
why assert here but not when calling
delegate.onFailure(e);?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.
Thanks, added that in ca31964 and tests seems unaffected.