storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [2/5] storm git commit: added closedbyinterruptexception wherever required
Date Mon, 09 Jan 2017 01:36:46 GMT
added closedbyinterruptexception wherever required


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

Branch: refs/heads/master
Commit: 0e0e091f04c7e26b45b6fe87659cb2ad60eb6a92
Parents: 5a0835d
Author: Sanket <schintap@untilservice-lm>
Authored: Tue Jan 3 11:03:54 2017 -0600
Committer: Sanket <schintap@untilservice-lm>
Committed: Tue Jan 3 11:03:54 2017 -0600

----------------------------------------------------------------------
 storm-core/src/jvm/org/apache/storm/ProcessSimulator.java       | 3 +++
 storm-core/src/jvm/org/apache/storm/StormTimer.java             | 4 +++-
 .../src/jvm/org/apache/storm/blobstore/BlobSynchronizer.java    | 5 +++--
 storm-core/src/jvm/org/apache/storm/command/HealthCheck.java    | 3 ++-
 .../jvm/org/apache/storm/container/cgroup/SystemOperation.java  | 3 ++-
 .../apache/storm/daemon/drpc/BlockingOutstandingRequest.java    | 1 +
 storm-core/src/jvm/org/apache/storm/event/EventManagerImp.java  | 5 ++++-
 7 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java b/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
index f8de869..1388e07 100644
--- a/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
+++ b/storm-core/src/jvm/org/apache/storm/ProcessSimulator.java
@@ -19,6 +19,7 @@ package org.apache.storm;
 import org.apache.storm.daemon.Shutdownable;
 import org.apache.storm.utils.Utils;
 
+import java.nio.channels.ClosedByInterruptException;
 import java.util.Collection;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
@@ -82,6 +83,8 @@ public class ProcessSimulator {
             } catch (Exception e) {
                 if (Utils.exceptionCauseIsInstanceOf(InterruptedException.class, e)) {
                     LOG.warn("process {} not killed (Ignoring InterruptedException)", pid,
e);
+                } else if (Utils.exceptionCauseIsInstanceOf(ClosedByInterruptException.class,
e)) {
+                    LOG.warn("process {} not killed (Ignoring ClosedByInterruptException)",
pid, e);
                 } else if (e instanceof RuntimeException){
                     throw e;
                 } else {

http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/StormTimer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/StormTimer.java b/storm-core/src/jvm/org/apache/storm/StormTimer.java
index 0dac347..5fbe379 100644
--- a/storm-core/src/jvm/org/apache/storm/StormTimer.java
+++ b/storm-core/src/jvm/org/apache/storm/StormTimer.java
@@ -23,6 +23,7 @@ import org.apache.storm.utils.Utils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.nio.channels.ClosedByInterruptException;
 import java.util.Comparator;
 import java.util.Random;
 import java.util.concurrent.PriorityBlockingQueue;
@@ -100,7 +101,8 @@ public class StormTimer implements AutoCloseable {
                         Time.sleep(1000);
                     }
                 } catch (Throwable e) {
-                    if (!(Utils.exceptionCauseIsInstanceOf(InterruptedException.class, e)))
{
+                    if (!(Utils.exceptionCauseIsInstanceOf(InterruptedException.class, e))
+                            && !(Utils.exceptionCauseIsInstanceOf(ClosedByInterruptException.class,
e))) {
                         this.onKill.uncaughtException(this, e);
                         this.setActive(false);
                     }

http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/blobstore/BlobSynchronizer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/blobstore/BlobSynchronizer.java b/storm-core/src/jvm/org/apache/storm/blobstore/BlobSynchronizer.java
index bd34c32..3d26a97 100644
--- a/storm-core/src/jvm/org/apache/storm/blobstore/BlobSynchronizer.java
+++ b/storm-core/src/jvm/org/apache/storm/blobstore/BlobSynchronizer.java
@@ -22,6 +22,7 @@ import org.apache.curator.framework.CuratorFramework;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.nio.channels.ClosedByInterruptException;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
@@ -86,8 +87,8 @@ public class BlobSynchronizer {
             if (zkClient !=null) {
                 zkClient.close();
             }
-        } catch(InterruptedException exp) {
-            LOG.error("InterruptedException {}", exp);
+        } catch(InterruptedException | ClosedByInterruptException exp) {
+            LOG.error("Interrupt Exception {}", exp);
         } catch(Exception exp) {
             throw new RuntimeException(exp);
         }

http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/command/HealthCheck.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/command/HealthCheck.java b/storm-core/src/jvm/org/apache/storm/command/HealthCheck.java
index 576eb13..778e69d 100644
--- a/storm-core/src/jvm/org/apache/storm/command/HealthCheck.java
+++ b/storm-core/src/jvm/org/apache/storm/command/HealthCheck.java
@@ -26,6 +26,7 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.channels.ClosedByInterruptException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -105,7 +106,7 @@ public class HealthCheck {
                 return SUCCESS;
             }
             return FAILED_WITH_EXIT_CODE;
-        } catch (InterruptedException e) {
+        } catch (InterruptedException | ClosedByInterruptException e) {
             LOG.warn("Script:  {} timed out.", script);
             return TIMEOUT;
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/container/cgroup/SystemOperation.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/container/cgroup/SystemOperation.java b/storm-core/src/jvm/org/apache/storm/container/cgroup/SystemOperation.java
index 6872b4a..8ebd763 100644
--- a/storm-core/src/jvm/org/apache/storm/container/cgroup/SystemOperation.java
+++ b/storm-core/src/jvm/org/apache/storm/container/cgroup/SystemOperation.java
@@ -23,6 +23,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.nio.channels.ClosedByInterruptException;
 
 /**
  * A class that implements system operations for using cgroups
@@ -68,7 +69,7 @@ public class SystemOperation {
                 throw new IOException(errorOutput);
             }
             return output;
-        } catch (InterruptedException ie) {
+        } catch (InterruptedException | ClosedByInterruptException ie) {
             throw new IOException(ie);
         }
     }

http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/daemon/drpc/BlockingOutstandingRequest.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/daemon/drpc/BlockingOutstandingRequest.java
b/storm-core/src/jvm/org/apache/storm/daemon/drpc/BlockingOutstandingRequest.java
index 619af65..af3612a 100644
--- a/storm-core/src/jvm/org/apache/storm/daemon/drpc/BlockingOutstandingRequest.java
+++ b/storm-core/src/jvm/org/apache/storm/daemon/drpc/BlockingOutstandingRequest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.storm.daemon.drpc;
 
+import java.nio.channels.ClosedByInterruptException;
 import java.util.concurrent.Semaphore;
 
 import org.apache.storm.generated.DRPCExceptionType;

http://git-wip-us.apache.org/repos/asf/storm/blob/0e0e091f/storm-core/src/jvm/org/apache/storm/event/EventManagerImp.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/event/EventManagerImp.java b/storm-core/src/jvm/org/apache/storm/event/EventManagerImp.java
index 42e6d6b..e755891 100644
--- a/storm-core/src/jvm/org/apache/storm/event/EventManagerImp.java
+++ b/storm-core/src/jvm/org/apache/storm/event/EventManagerImp.java
@@ -23,6 +23,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.InterruptedIOException;
+import java.nio.channels.ClosedByInterruptException;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -54,8 +55,10 @@ public class EventManagerImp implements EventManager {
                         r.run();
                         proccessInc();
                     } catch (Throwable t) {
-                        if (Utils.exceptionCauseIsInstanceOf(InterruptedIOException.class,
t)) {
+                        if (Utils.exceptionCauseIsInstanceOf(InterruptedIOException.class,
t) ) {
                             LOG.info("Event manager interrupted while doing IO");
+                        } else if (Utils.exceptionCauseIsInstanceOf(ClosedByInterruptException.class,
t)) {
+                            LOG.info("Event manager interrupted while doing NIO");
                         } else if (Utils.exceptionCauseIsInstanceOf(InterruptedException.class,
t)) {
                             LOG.info("Event manager interrupted");
                         } else {


Mime
View raw message