diff options
Diffstat (limited to 'clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java')
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java index e4519a02632..d082158edc7 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java @@ -39,16 +39,30 @@ public abstract class RemoteClusterControllerTask { */ public boolean isFailed() { return false; } + public enum FailureCondition { + LEADERSHIP_LOST, + DEADLINE_EXCEEDED + } + /** - * If the task response has been deferred due to hasVersionAckDependency(), - * handleLeadershipLost() will be invoked on the task if the cluster controller + * If the task completion has been deferred due to hasVersionAckDependency(), + * this method will be invoked if a failure occurs before the version has + * been successfully ACKed. + * + * LEADERSHIP_LOST will be the failure condition if the cluster controller * discovers it has lost leadership in the time between task execution and - * deferred response send time. + * deferred completion time. + * + * DEADLINE_EXCEEDED will be the failure condition if the completion has been + * deferred for more than a configurable amount of time. * * This method will also be invoked if the controller is signalled to shut down * before the dependent cluster version has been published. + * + * The task implementation is responsible for communicating the appropriate + * error semantics to the caller who initially scheduled the task. */ - public void handleLeadershipLost() {} + public void handleFailure(FailureCondition condition) {} public boolean isCompleted() { synchronized (monitor) { |