geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [1/2] incubator-geode git commit: An atomic boolean is now used in Connection to make sure the socket is only scheduled once for asyncClose.
Date Fri, 18 Sep 2015 21:33:50 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-332 16a6bc1a6 -> 159d78167


An atomic boolean is now used in Connection to make sure the socket is only
scheduled once for asyncClose.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/718bb3f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/718bb3f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/718bb3f0

Branch: refs/heads/feature/GEODE-332
Commit: 718bb3f0f9b3fcff719c57d5143905d5e6aecc32
Parents: 16a6bc1
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Fri Sep 18 10:30:44 2015 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Fri Sep 18 10:30:44 2015 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/internal/tcp/Connection.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/718bb3f0/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java
index b341acc..6db01bd 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java
@@ -818,6 +818,8 @@ public class Connection implements Runnable {
     }
   }
   
+  private final AtomicBoolean asyncCloseCalled = new AtomicBoolean();
+  
   /**
    * asynchronously close this connection
    * 
@@ -845,7 +847,9 @@ public class Connection implements Runnable {
       r.run();
     }
     else {
-      this.owner.getSocketCloser().asyncClose(this.socket, String.valueOf(this.remoteAddr),
r);
+      if (this.asyncCloseCalled.compareAndSet(false, true)) {
+        this.owner.getSocketCloser().asyncClose(this.socket, String.valueOf(this.remoteAddr),
r);
+      }
     }
   }
   


Mime
View raw message