jiajunwang commented on a change in pull request #1468:
URL: https://github.com/apache/helix/pull/1468#discussion_r510487829
##########
File path: helix-core/src/main/java/org/apache/helix/task/TaskDriver.java
##########
@@ -699,6 +798,73 @@ private void addTaskToJobConfig(String workflowName,
String jobName, TaskConfig
throw new TimeoutException("An unexpected issue happened while task being
added to the job!");
}
+ /**
+ * A helper method which deletes an existing task from the job config and
verifies if task is
+ * deleted from the context by the controller.
+ * @param workflowName
+ * @param jobName
+ * @param taskID
+ * @param endTime
+ * @throws InterruptedException
+ * @throws TimeoutException
+ */
+ private void deleteTaskFromJobConfig(String workflowName, String jobName,
String taskID,
Review comment:
Logs can be changed to "failed to update the task from the job...", etc.
The updater can be changed to be a parameter.
As for the additional check you mentioned, is it necessary? Since the
updater is done, task modification has to be finished in the ZK. If the
rebalancer runs slow, then the timeout will fail the operation even the task
has been added/removed correctly.
Even we do want to wait, it is still doable by passing a verifier-style
callback and then we can merge the private methods.
Or, alternatively, you can check the jobContext in the upper layer method
after calls this generic task modification method. Note that since you are
calling the accessor 2 times for the jobcontext and workflowcontext, there is
no guarantee that the result is consistent anyway. So moving the jobcontext
check outside will not introduce more issues.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]