streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [2/3] incubator-streams git commit: one hunk was rejected
Date Fri, 23 Oct 2015 21:26:54 GMT
one hunk was rejected


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/a3c2ef85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/a3c2ef85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/a3c2ef85

Branch: refs/heads/master
Commit: a3c2ef850d16a300d9e70e75548099ad31493754
Parents: bf70f28
Author: Steve Blackmon (@steveblackmon) <sblackmon@apache.org>
Authored: Sun Sep 13 17:31:07 2015 -0500
Committer: Steve Blackmon (@steveblackmon) <sblackmon@apache.org>
Committed: Sun Sep 13 17:31:07 2015 -0500

----------------------------------------------------------------------
 .../streams/local/builders/LocalStreamBuilder.java    | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/a3c2ef85/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
----------------------------------------------------------------------
diff --git a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
index 3f65c65..71dc7a6 100644
--- a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
+++ b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
@@ -409,10 +409,11 @@ public class LocalStreamBuilder implements StreamBuilder {
                 }
                 for(StreamsTask task : tasks) {
                     int count = 0;
-                    while(count < 20 && task.isRunning()) {
-                        Thread.sleep(500);
+                    while(count < streamConfig.getTaskTimeoutMs() / 1000 && task.isRunning())
{
+                        Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
                         count++;
                     }
+
                     if(task.isRunning()) {
                         LOGGER.warn("Task {} failed to terminate in allotted timeframe",
task.toString());
                     }
@@ -444,8 +445,13 @@ public class LocalStreamBuilder implements StreamBuilder {
             LOGGER.error("Exception while trying to shutdown Stream: {}", e);
             forceShutdown(tasks);
         } finally {
-            if(!systemExiting) {
-                detachShutdownHandler();
+            try {
+                 if(!systemExiting) {
+                      detachShutdownHandler();
+                  }
+               } catch( Throwable e3 ) {
+                 LOGGER.error("StopInternal caught Throwable: {}", e3);
+                       System.exit(1);
             }
         }
     }


Mime
View raw message