asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [NO ISSUE][*DB][CLUS] Fix intermittent deadlock on nc join
Date Tue, 10 Oct 2017 17:17:48 GMT
Michael Blow has uploaded a new change for review.

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

Change subject: [NO ISSUE][*DB][CLUS] Fix intermittent deadlock on nc join
......................................................................

[NO ISSUE][*DB][CLUS] Fix intermittent deadlock on nc join

Ensure lock on ResourceIdManager is released before obtaining lock on
ClusterStateManager, as ClusterStateManager obtains locks on
ResourceIdManager

Change-Id: I691fc06da3f5641904e02ece8ae1b5fe3fc286a3
---
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/transaction/ResourceIdManager.java
1 file changed, 12 insertions(+), 8 deletions(-)


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

diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/transaction/ResourceIdManager.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/transaction/ResourceIdManager.java
index afa626d..9d5c4c4 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/transaction/ResourceIdManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/transaction/ResourceIdManager.java
@@ -60,16 +60,20 @@
     }
 
     @Override
-    public synchronized void report(String nodeId, long maxResourceId) throws HyracksDataException
{
-        if (!allReported) {
-            globalResourceId.set(Math.max(maxResourceId, globalResourceId.get()));
-            reportedNodes.add(nodeId);
-            if (reportedNodes.size() == csm.getNumberOfNodes()) {
-                reportedNodes = null;
-                allReported = true;
-                csm.refreshState();
+    public void report(String nodeId, long maxResourceId) throws HyracksDataException {
+        synchronized (this) {
+            if (!allReported) {
+                globalResourceId.set(Math.max(maxResourceId, globalResourceId.get()));
+                reportedNodes.add(nodeId);
+                if (reportedNodes.size() == csm.getNumberOfNodes()) {
+                    reportedNodes = null;
+                    allReported = true;
+                }
             }
         }
+        if (allReported) {
+            csm.refreshState();
+        }
     }
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I691fc06da3f5641904e02ece8ae1b5fe3fc286a3
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mblow@apache.org>

Mime
View raw message