Skip to content

Conversation

metacosm
Copy link
Collaborator

Fixes #2551

Signed-off-by: Chris Laprun [email protected]

Copy link
Collaborator

@csviri csviri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@metacosm I made some comments, what is the intention regarding v5? Is this a problem also there? I'm fine with this only if we in v5 won't be handled this way, especially with the context value.

@@ -102,6 +105,8 @@ public WorkflowCleanupResult cleanup(P primary, Context<P> context) {
WorkflowCleanupExecutor<P> workflowCleanupExecutor =
new WorkflowCleanupExecutor<>(this, primary, context);
var result = workflowCleanupExecutor.cleanup();
context.managedDependentResourceContext()
.put(DefaultManagedDependentResourceContext.CLEANUP_RESULT_KEY, result);
if (throwExceptionAutomatically) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't rather only this throw removed?
It seems to be redundant. If I remember correctly I was solving this for v5, there it seems to have different structure now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's slightly different in v5 but the problem is still present in a somewhat different form, though.

@Override
public Optional<WorkflowReconcileResult> getWorkflowReconcileResult() {
return Optional.ofNullable(workflowReconcileResult);
return get(RECONCILE_RESULT_KEY, WorkflowReconcileResult.class);
Copy link
Collaborator

@csviri csviri Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should solve this this way (with the context map), only if there is no other way around this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it's not super nice but the current way is not great either (casting to the implementation, which is not a given, especially during tests since it breaks with mocks). I actually had a different implementation initially but I would like to remove the reliance on a specific implementation and a cast to it because I don't think it's a nice design.

@metacosm metacosm merged commit 73e3dfc into main Oct 28, 2024
20 checks passed
@metacosm metacosm deleted the fix-2551 branch October 28, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing workflowExecutionResult during error handling with Managed Workflow
2 participants