My understanding is the
new RetryOptions.Builder().setDoNotRetry() is to explicitly set exceptions where we do not want the workflow or activity to retry.
This seems to correspond to
NonRetryableErrorReasons in the main website documentation when describing retry policies:
NonRetryableErrorReasonsallows to specify errors that shouldn’t be retried. For example, retrying invalid arguments error doesn’t make sense in some scenarios.
However, the documentation for
setDoNotRetry says the exceptions are the “List of exceptions to retry”.
Furthermore, the docs also say that “When matching an exact match is used,” but this RpcRetryer code suggests that it checks the superclass of the exceptions when deciding whether to retry.
Am I misunderstanding something or looking at the wrong source code?
This is related to an error I’m debugging why a Child Workflow didn’t retry even though the retry policy should have allowed it to retry:
NonRetriableErrorReasons is only set to
However, Child Workflow fails due to
ActivityFailureException with cause
JobKilledException instead of retrying.
In the activity code, it throws the exception
throw new JobKilledException()without wrapping it because