TaskExecutionInterceptor

TaskExecutionInterceptor is a hook point to customize the specific execution of a task.

Before execute is called on a Task, all TaskExecutionInterceptors will be called. The resulting Stage object from beforeTaskExecution is passed to subsequent invocations of TaskExecutionInterceptor and then used for the invocation of execute on Task.

After a Task completes with a TaskResult, all TaskExecutionInterceptors are called. The resulting TaskResult is passed to subsequent invocations ot TaskExecutionInterceptor and the final TaskResult is used as the output of the task.

A TaskExecutionInterceptor can specify the maximum backoff that should be allowed. As an example, the LockExtendingTaskExecutionInterceptor needs to ensure that a task doesn't delay longer than the lock extension. The minimum maxTaskBackoff among all registered TaskExecutionInterceptors will be used to constrain the task backoff supplied by a RetryableTask.

public interface TaskExecutionInterceptor implements SpinnakerExtensionPoint

Functions

afterTaskExecution
Link copied to clipboard

hook that is called after a task executes successfully.

As an example you can modify the taskResult here before it gets propagated.

beforeTaskExecution
Link copied to clipboard

hook that is called before a task executes.

finallyAfterTaskExecution
Link copied to clipboard

hook that is guaranteed to be called, even when a task throws an exception which will cause afterTaskExecution to not be called.

As an example you can clear the security context here if you set it in the beforeTaskExecution hook.

getExtensionClass
Link copied to clipboard
Class<? extends SpinnakerExtensionPointgetExtensionClass()
getPluginId
Link copied to clipboard
String getPluginId()
maxTaskBackoff
Link copied to clipboard

hook that is called to program the collective maximum backoff of all TaskExecutionInterceptors. A retryable task has a backoff period which is configured by defaults and then constrained by the minimum backoff configured by all registered interceptors.

long maxTaskBackoff()