Skip to content

Missing workflowExecutionResult during error handling with Managed Workflow #2551

Closed
@murillio4

Description

@murillio4

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 DefaultWorkflowhandles 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions