-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Include the calling transport task in the method for individual node task operations #88081
Include the calling transport task in the method for individual node task operations #88081
Conversation
Pinging @elastic/es-distributed (Team:Distributed) |
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.
LGTM although I have minor (non-blocking) concerns about naming.
@@ -113,6 +113,7 @@ protected void processTasks(final FollowStatsAction.StatsRequest request, final | |||
|
|||
@Override | |||
protected void taskOperation( | |||
Task transportTask, |
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.
Harmonisation nit:
Task transportTask, | |
final Task transportTask, |
*/ | ||
protected abstract void taskOperation(TasksRequest request, OperationTask task, ActionListener<TaskResponse> listener); | ||
protected abstract void taskOperation( | ||
Task transportTask, |
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.
I worry a bit about the name transportTask
, given that many of these tasks actions will be iterating over transport tasks too. What about requestTask
or actionTask
perhaps?
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.
actionTask
is nice. I will rename to that
@elasticmachine update branch |
We pass the actionTask to the subsequent task action so that the task action can be cancelled if the upstream tasks are cancelled. But, the actionTask passed is created by the `NodeTaskRequest`, which isn't cancellable. This commit addresses this discrepancy and allows for down stream task actions to be cancelled if the upstream http connections are closed. Related to: #88081
Currently, if the parent transport task is cancelled, there is no way to propagate the cancellation to any NEW transport action inacted by
TransportTasksAction#taskOperation
.This commit passes the originating transport task into
TransportTasksAction#taskOperation
so that any additional transport actions can be cancelled if the originating transport task is cancelled.Note: it is up to the implementer to enable this cancellation logic. This commit simply updates the framework to make it possible.