brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [3/5] brooklyn-server git commit: suppress warning on task finalization if its execution context is shutdown
Date Fri, 10 Nov 2017 10:58:22 GMT
suppress warning on task finalization if its execution context is shutdown


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/447cac71
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/447cac71
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/447cac71

Branch: refs/heads/master
Commit: 447cac711463f5ef1bf685759f167e88580b759e
Parents: 2900156
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Nov 3 14:13:50 2017 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Nov 3 14:13:50 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/util/core/task/BasicTask.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/447cac71/core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java b/core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java
index 4913ab3..e7278912 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java
@@ -43,6 +43,7 @@ import java.util.concurrent.TimeoutException;
 
 import org.apache.brooklyn.api.mgmt.HasTaskChildren;
 import org.apache.brooklyn.api.mgmt.Task;
+import org.apache.brooklyn.core.mgmt.BrooklynTaskTags;
 import org.apache.brooklyn.util.JavaGroovyEquivalents;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.guava.Maybe;
@@ -808,10 +809,10 @@ public class BasicTask<T> implements TaskInternal<T> {
                 return;
             }
             if (!t.isDone()) {
-                // shouldn't happen
-                // TODO But does happen if management context was terminated (e.g. running
test suite).
-                //      Should check if Execution Manager is running, and only log if it
was not terminated?
-                log.warn("Task "+t+" is being finalized before completion");
+                if (!BrooklynTaskTags.getExecutionContext(t).isShutdown()) {
+                    // not sure how this could happen
+                    log.warn("Task "+t+" was submitted but forgotten before it was run (finalized
before completion)");
+                }
                 return;
             }
         }


Mime
View raw message