Package com.google.gerrit.server
Interface ExceptionHook
-
public interface ExceptionHook
Allows implementors to control how certain exceptions should be handled.This interface is intended to be implemented for cluster setups with multiple primary nodes to control the behavior for handling exceptions that are thrown by a lower layer that handles the consensus and synchronization between different server nodes. E.g. if an operation fails because consensus for a Git update could not be achieved (e.g. due to slow responding server nodes) this interface can be used to retry the request instead of failing it immediately.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
shouldRetry(Throwable throwable)
Whether an operation should be retried if it failed with the given throwable.
-
-
-
Method Detail
-
shouldRetry
default boolean shouldRetry(Throwable throwable)
Whether an operation should be retried if it failed with the given throwable.Only affects operations that are executed with
RetryHelper
.- Parameters:
throwable
- throwable that was thrown while executing the operation- Returns:
- whether the operation should be retried
-
-