Description
Bug Report
What did you do?
I attempted to handle errored dependents within managed workflow. I implemented ErrorStatusHandler
in my reconciler and configured updateErrorStatus
to update the CRD status with a list of failed dependents (including error messages) and successful dependents.
What did you expect to see?
The CRD status should display a list of failed dependents (with error messages) and successful dependents.
What did you see instead? Under which circumstances?
The CRD status was not updated because getWorkflowReconcileResult()
returned null.
Environment
AKS kubernetes version: 1.30.4
$ Mention java-operator-sdk version from pom.xml file
4.9.4
$ java -version
openjdk 21 2023-09-19
OpenJDK Runtime Environment (build 21+35-2513)
OpenJDK 64-Bit Server VM (build 21+35-2513, mixed mode, sharing)
$ kubectl version
Client Version: v1.30.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.4
Possible Explenation
I seems both Controller.execute and DefaultWorkflow.reconcile are designed to handle workflow errors via throwAggregateExceptionIfErrorsPresent
. The DefaultWorkflow
handles errors only if throwExceptionAutomatically is set to true
, which it is by default (THROW_EXCEPTION_AUTOMATICALLY_DEFAULT
is true
).
However, the issue is that Controller.execute
is responsible for setting the workflowExecutionResult
. Since DefaultWorkflow.reconcile
throws an exception when handling errors with throwAggregateExceptionIfErrorsPresent
, the error handling in Controller.execute
never hits, and workflowExecutionResult
is never set.