Xikui Wang has uploaded a new change for review.

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

Change subject: [NO ISSUE][RT] Remove runtime from ActiveManager after it stops
......................................................................

[NO ISSUE][RT] Remove runtime from ActiveManager after it stops

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
The runtime should not be removed before it's fully stopped. This may
causes issues when downstream operators need to access runtime during
shutdown.

Change-Id: I07c6398f46d4bb6d29b270aa71dee36e0d0917ae
---
M 
asterixdb/asterix-active/src/main/java/org/apache/asterix/active/ActiveManager.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/94/2494/1

diff --git 
a/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/ActiveManager.java
 
b/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/ActiveManager.java
index bb76204..09c08f8 100644
--- 
a/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/ActiveManager.java
+++ 
b/asterixdb/asterix-active/src/main/java/org/apache/asterix/active/ActiveManager.java
@@ -178,8 +178,9 @@
 
     private void stopIfRunning(ActiveRuntimeId runtimeId, IActiveRuntime 
runtime)
             throws HyracksDataException, InterruptedException {
-        if (runtimes.remove(runtimeId) != null) {
+        if (runtimes.containsKey(runtimeId)) {
             runtime.stop();
+            runtimes.remove(runtimeId);
         } else {
             LOGGER.info("Not stopping already stopped runtime " + runtimeId);
         }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07c6398f46d4bb6d29b270aa71dee36e0d0917ae
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Xikui Wang <[email protected]>

Reply via email to