This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
The following commit(s) were added to refs/heads/master by this push:
new 9f555237ed catch error if workflow entity is unmanaged
9f555237ed is described below
commit 9f555237edfaf293a3c04c32cf2e28a068f7dd2a
Author: Alex Heneveld <[email protected]>
AuthorDate: Mon Jun 26 18:53:06 2023 +0100
catch error if workflow entity is unmanaged
---
.../apache/brooklyn/core/workflow/WorkflowExecutionContext.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git
a/core/src/main/java/org/apache/brooklyn/core/workflow/WorkflowExecutionContext.java
b/core/src/main/java/org/apache/brooklyn/core/workflow/WorkflowExecutionContext.java
index 33c7722a50..f912c5b194 100644
---
a/core/src/main/java/org/apache/brooklyn/core/workflow/WorkflowExecutionContext.java
+++
b/core/src/main/java/org/apache/brooklyn/core/workflow/WorkflowExecutionContext.java
@@ -892,7 +892,14 @@ public class WorkflowExecutionContext {
}
if (currentStepInstance!=null) {
-
considerTask.accept(getManagementContext().getExecutionManager().getTask(currentStepInstance.getTaskId()));
+ Task<?> lastTask = null;
+ try {
+ lastTask =
getManagementContext().getExecutionManager().getTask(currentStepInstance.getTaskId());
+ } catch (Exception e) {
+ // probably not being managed; ignore
+ Exceptions.propagateIfFatal(e);
+ }
+ considerTask.accept(lastTask);
}
return result.get();