Repository: asterixdb
Updated Branches:
  refs/heads/master afe0d3d99 -> 18ef4b99a


[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>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/18ef4b99
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/18ef4b99
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/18ef4b99

Branch: refs/heads/master
Commit: 18ef4b99aec3e97bfc59e5960e24073d9d6b57a7
Parents: afe0d3d
Author: Abdullah Alamoudi <bamou...@gmail.com>
Authored: Sun Feb 18 21:18:51 2018 -0800
Committer: Michael Blow <mb...@apache.org>
Committed: Mon Feb 19 10:08:17 2018 -0800

----------------------------------------------------------------------
 .../hyracks/ipc/impl/ReconnectingIPCHandle.java    | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/18ef4b99/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/ReconnectingIPCHandle.java
----------------------------------------------------------------------
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 @@ class ReconnectingIPCHandle implements IIPCHandle {
         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;
+        }
     }
 
 }

Reply via email to