You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by ti...@apache.org on 2015/11/23 21:45:24 UTC

[1/2] incubator-apex-core git commit: APEX-275 #resolve #comment Added synchronized block so no two threads will try to reconnect to websocket server

Repository: incubator-apex-core
Updated Branches:
  refs/heads/devel-3 892355ca1 -> 9656248cf


APEX-275 #resolve #comment Added synchronized block so no two threads will try to reconnect to websocket server


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/commit/d71473da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/tree/d71473da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/diff/d71473da

Branch: refs/heads/devel-3
Commit: d71473dafb5d501fcb5b71ecc799dc63e6ecfacc
Parents: ca542e3
Author: David Yan <da...@datatorrent.com>
Authored: Thu Nov 19 14:36:44 2015 -0800
Committer: Timothy Farkas <ti...@datatorrent.com>
Committed: Mon Nov 23 12:20:58 2015 -0800

----------------------------------------------------------------------
 .../stram/util/SharedPubSubWebSocketClient.java   | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/d71473da/engine/src/main/java/com/datatorrent/stram/util/SharedPubSubWebSocketClient.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/util/SharedPubSubWebSocketClient.java b/engine/src/main/java/com/datatorrent/stram/util/SharedPubSubWebSocketClient.java
index 96d5a40..7516e46 100644
--- a/engine/src/main/java/com/datatorrent/stram/util/SharedPubSubWebSocketClient.java
+++ b/engine/src/main/java/com/datatorrent/stram/util/SharedPubSubWebSocketClient.java
@@ -102,16 +102,18 @@ public class SharedPubSubWebSocketClient extends PubSubWebSocketClient
   @Override
   public void publish(String topic, Object data) throws IOException
   {
-    if (!isConnectionOpen()) {
-      try {
-        long now = System.currentTimeMillis();
-        if (lastConnectTryTime + minWaitConnectionRetry < now) {
-          lastConnectTryTime = now;
-          openConnectionAsync();
+    synchronized (this) {
+      if (!isConnectionOpen()) {
+        try {
+          long now = System.currentTimeMillis();
+          if (lastConnectTryTime + minWaitConnectionRetry < now) {
+            lastConnectTryTime = now;
+            openConnectionAsync();
+          }
+        } catch (Exception ex) {
+          LOG.debug("Failed attempt to reconnect to websocket server", ex);
         }
       }
-      catch (Exception ex) {
-      }
     }
     super.publish(topic, data);
   }


[2/2] incubator-apex-core git commit: Merge branch 'SPOI-6624-devel-3' into devel-3

Posted by ti...@apache.org.
Merge branch 'SPOI-6624-devel-3' into devel-3


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/commit/9656248c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/tree/9656248c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/diff/9656248c

Branch: refs/heads/devel-3
Commit: 9656248cf63c3be12ba06d01c0caef9fd061664d
Parents: 892355c d71473d
Author: Timothy Farkas <ti...@datatorrent.com>
Authored: Mon Nov 23 12:24:33 2015 -0800
Committer: Timothy Farkas <ti...@datatorrent.com>
Committed: Mon Nov 23 12:24:33 2015 -0800

----------------------------------------------------------------------
 .../stram/util/SharedPubSubWebSocketClient.java   | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------