asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xikui Wang (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb-bad[master]: [BAD] Fix NPE in drop channelStatement
Date Tue, 11 Jul 2017 02:00:55 GMT
Xikui Wang has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1876

Change subject: [BAD] Fix NPE in drop channelStatement
......................................................................

[BAD] Fix NPE in drop channelStatement

When system restart with pre-created but not active channel, the
drop channel statement will cause NPE, as whether listener is
active or not is not checked.

Change-Id: I1a2ba1ea70ac567c287a6a0c3a70090a4e9c477a
---
M asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-bad refs/changes/76/1876/1

diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
index 1b655da..fdec8a1 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
@@ -112,12 +112,14 @@
                 }
             }
 
-            listener.getExecutorService().shutdownNow();
-            JobId hyracksJobId = listener.getJobId();
-            listener.deActivate();
-            activeEventHandler.removeListener(listener);
-            if (hyracksJobId != null) {
-                hcc.destroyJob(hyracksJobId);
+            if (listener != null) {
+                listener.getExecutorService().shutdownNow();
+                JobId hyracksJobId = listener.getJobId();
+                listener.deActivate();
+                activeEventHandler.removeListener(listener);
+                if (hyracksJobId != null) {
+                    hcc.destroyJob(hyracksJobId);
+                }
             }
 
             //Create a metadata provider to use in nested jobs.

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1876
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a2ba1ea70ac567c287a6a0c3a70090a4e9c477a
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Owner: Xikui Wang <xkkwww@gmail.com>

Mime
View raw message