Michael Blow has submitted this change and it was merged.

Change subject: [NO ISSUE][CLUS] Synchronize restoration of IPC connection
......................................................................


[NO ISSUE][CLUS] Synchronize restoration of IPC connection

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

details:
- When an IPC connection is dead, then only a single sender
  will revive the connection.

Change-Id: I1ec58d7fbc96d7352882e6588ef2ce12dc66511e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2397
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>
---
M 
hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/ReconnectingIPCHandle.java
1 file changed, 11 insertions(+), 6 deletions(-)

Approvals:
  Anon. E. Moose #1000171: 
  Jenkins: Verified; No violations found; ; Verified
  Michael Blow: Looks good to me, approved



diff --git 
a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/ReconnectingIPCHandle.java
 
b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/ReconnectingIPCHandle.java
index 9a2fc80..db0ed6b 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/ReconnectingIPCHandle.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/ReconnectingIPCHandle.java
@@ -72,12 +72,17 @@
         if (delegate.isConnected()) {
             return delegate;
         }
-        LOGGER.warn("ipcHandle {} disconnected; will attempt to reconnect {} 
times", delegate, reconnectAttempts);
-        listener.ipcHandleDisconnected(delegate);
-        delegate = ipc.getHandle(getRemoteAddress(), reconnectAttempts);
-        LOGGER.warn("ipcHandle {} restored", delegate);
-        listener.ipcHandleRestored(delegate);
-        return delegate;
+        synchronized (this) {
+            if (delegate.isConnected()) {
+                return delegate;
+            }
+            LOGGER.warn("ipcHandle {} disconnected; will attempt to reconnect 
{} times", delegate, reconnectAttempts);
+            listener.ipcHandleDisconnected(delegate);
+            delegate = ipc.getHandle(getRemoteAddress(), reconnectAttempts);
+            LOGGER.warn("ipcHandle {} restored", delegate);
+            listener.ipcHandleRestored(delegate);
+            return delegate;
+        }
     }
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ec58d7fbc96d7352882e6588ef2ce12dc66511e
Gerrit-PatchSet: 5
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamou...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamou...@gmail.com>

Reply via email to