Interface ClusterStateTaskListener

All Known Implementing Classes:
AckedBatchedClusterStateUpdateTask, AckedClusterStateUpdateTask, ClusterStateUpdateTask, DeleteIndexClusterStateUpdateRequest, IngestService.DeletePipelineClusterStateUpdateTask, IngestService.PipelineClusterStateUpdateTask, IngestService.PutPipelineClusterStateUpdateTask, JoinTask, LocalMasterServiceTask, MigrationResultsUpdateTask, NodeLeftExecutor.Task, RepositoriesService.RegisterRepositoryTask, RepositoriesService.UnregisterRepositoryTask, ReservedStateErrorTask, ReservedStateUpdateTask, ShardStateAction.FailedShardUpdateTask, ShardStateAction.StartedShardUpdateTask, SystemIndexMetadataUpgradeService.SystemIndexMetadataUpdateTask, TransportDeleteDesiredBalanceAction.ResetDesiredBalanceTask

public interface ClusterStateTaskListener
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    A callback for when task execution fails.
  • Method Details

    • onFailure

      void onFailure(Exception e)
      A callback for when task execution fails. May receive a NotMasterException if this node stopped being the master before this task was executed or a ProcessClusterEventTimeoutException if the task timed out before it was executed. If the task fails during execution then this method receives the corresponding exception. If the task executes successfully but the resulting cluster state publication fails then this method receives a FailedToCommitClusterStateException. If publication fails then a new master is elected and the update might or might not take effect, depending on whether or not the newly-elected master accepted the published state that failed to be committed.

      Use MasterService.isPublishFailureException(java.lang.Exception) to detect the "expected" master failure cases if needed.

      Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service at ERROR level and otherwise ignored, except in tests where it raises an AssertionError. If log-and-ignore is the right behaviour then implementations must do so themselves, typically using a more specific logger and at a less dramatic log level.