STORM-1837: Minor style cleanup

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

Branch: refs/heads/master
Commit: 0264698419b7da82eb494c4c23a6f8b185583229
Parents: 3457a03
Author: Stig Rohde Døssing <s...@it-minds.dk>
Authored: Mon Aug 29 09:49:42 2016 +0200
Committer: Stig Rohde Døssing <stigdoess...@gmail.com>
Committed: Wed Aug 31 17:45:29 2016 +0200

----------------------------------------------------------------------
 .../src/jvm/org/apache/storm/messaging/local/Context.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/02646984/storm-core/src/jvm/org/apache/storm/messaging/local/Context.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/messaging/local/Context.java 
b/storm-core/src/jvm/org/apache/storm/messaging/local/Context.java
index b53b86b..30c7936 100644
--- a/storm-core/src/jvm/org/apache/storm/messaging/local/Context.java
+++ b/storm-core/src/jvm/org/apache/storm/messaging/local/Context.java
@@ -17,7 +17,6 @@
  */
 package org.apache.storm.messaging.local;
 
-import java.lang.Thread.UncaughtExceptionHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -111,6 +110,7 @@ public class Context implements IContext {
                         flushPending();
                     } catch (Throwable t) {
                         LOG.error("Uncaught throwable in pending message 
flusher thread, messages may be lost", t);
+                        throw t;
                     }
                 }
             }, 5, 5, TimeUnit.SECONDS);
@@ -169,6 +169,11 @@ public class Context implements IContext {
         @Override
         public void close() {
             _pendingFlusher.shutdown();
+            try{
+                _pendingFlusher.awaitTermination(5, TimeUnit.SECONDS);
+            } catch (InterruptedException e){
+                throw new RuntimeException("Interrupted while awaiting flusher 
shutdown", e);
+            }
         }
     };
 

Reply via email to