GEODE-3286: Improving closed connection check Signed-off-by: Hitesh Khamesra <hitesh...@yahoo.com> Signed-off-by: Brian Rowe <br...@pivotal.io>
Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/7e06476d Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/7e06476d Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/7e06476d Branch: refs/heads/develop Commit: 7e06476d0eb9e879668956c112f44a4cabdb2837 Parents: 4ee96cf Author: Brian Rowe <br...@pivotal.io> Authored: Thu Jul 27 14:09:24 2017 -0700 Committer: Brian Rowe <br...@pivotal.io> Committed: Fri Jul 28 17:15:37 2017 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/geode/internal/tcp/ConnectionTable.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/7e06476d/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java index 0be5f28..69fb7a2 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java +++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java @@ -296,7 +296,9 @@ public class ConnectionTable { .toLocalizedString(), connection); return; } - if (!connection.isSocketClosed()) { + // If connection.stopped is false, any connection cleanup thread will not yet have acquired + // the receiver synchronization to remove the receiver. Therefore we can safely add it here. + if (!connection.isSocketClosed() || connection.stopped) { this.receivers.add(connection); } }