Repository: incubator-geode
Updated Branches:
  refs/heads/develop 8c690ac6a -> be74e3a1e


GEODE-934: CI failure: 
DurableClientSimpleDUnitTest.testReadyForEventsNotCalledImplicitlyWithCacheXML.

In this test the client sees previously delivered events, when it disconnects 
and reconnects immediately.
This happens when the message dispatcher is in the process of removing the 
messages while its in the pause state; and client reconnects at the same time. 
When client reconnects, it clears out the acked-event list, this causes the 
message dispatcher thread not to remove dispatched event from the queue. The 
fix is to take the pause lock and start removing the dispatched event, this 
blocks the client reconnect process to wait tille the messages are removed.

Testing:
The test used to fail once in 4 runs. With the change it run for 50 times.
precheckin


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

Branch: refs/heads/develop
Commit: be74e3a1e9ea0699743dd7ec9e63774402d3542e
Parents: 8c690ac
Author: agingade <[email protected]>
Authored: Tue Mar 15 15:31:37 2016 -0700
Committer: agingade <[email protected]>
Committed: Fri Mar 18 11:23:55 2016 -0700

----------------------------------------------------------------------
 .../cache/tier/sockets/CacheClientProxy.java    | 25 ++++++++++----------
 1 file changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/be74e3a1/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
index 6edb570..d6226b5 100755
--- 
a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
+++ 
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheClientProxy.java
@@ -2582,21 +2582,20 @@ public class CacheClientProxy implements ClientSession {
         try {
           // If paused, wait to be told to resume (or interrupted if stopped)
           if (getProxy().isPaused()) {
-            try {
-              // ARB: Before waiting for resumption, process acks from client. 
-              // This will reduce the number of duplicates that a client 
receives after
-              // reconnecting.
-              if (this._messageQueue.size() > 0) {
-                Thread.sleep(50);
-              }
-              logger.info("available ids = " + this._messageQueue.size()+ " , 
isEmptyAckList =" + this._messageQueue.isEmptyAckList() 
+            // ARB: Before waiting for resumption, process acks from client. 
+            // This will reduce the number of duplicates that a client 
receives after
+            // reconnecting.
+            synchronized (_pausedLock) {
+              try {
+                logger.info("available ids = " + this._messageQueue.size()+ " 
, isEmptyAckList =" + this._messageQueue.isEmptyAckList() 
                             + ", peekInitialized = " + 
this._messageQueue.isPeekInitialized());
-              while (!this._messageQueue.isEmptyAckList()&& 
this._messageQueue.isPeekInitialized()) {
-                this._messageQueue.remove();
+                while (!this._messageQueue.isEmptyAckList()&& 
this._messageQueue.isPeekInitialized()) {
+                  this._messageQueue.remove();
+                }
+              }
+              catch (InterruptedException ex) {
+                
logger.warn(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0_SLEEP_INTERRUPTED,
 this));
               }
-            }
-            catch (InterruptedException ex) {
-              
logger.warn(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0_SLEEP_INTERRUPTED,
 this));
             }
             waitForResumption();
           }

Reply via email to