[ 
https://issues.apache.org/jira/browse/GEODE-8706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17232960#comment-17232960
 ] 

ASF GitHub Bot commented on GEODE-8706:
---------------------------------------

boglesby commented on a change in pull request #5750:
URL: https://github.com/apache/geode/pull/5750#discussion_r524456655



##########
File path: 
geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
##########
@@ -295,9 +301,16 @@ public Connection getConnection(boolean 
startAckReaderThread) throws GatewaySend
     // OR the connection's ServerLocation doesn't match with the one stored in 
sender
     // THEN initialize the connection
     if (!this.sender.isParallel()) {
-      if (this.connection == null || this.connection.isDestroyed()
-          || this.connection.getServer() == null
-          || 
!this.connection.getServer().equals(this.sender.getServerLocation())) {
+      boolean needToReconnect = false;
+      getConnectionLifeCycleLock().readLock().lock();
+      try {
+        needToReconnect = this.connection == null || 
this.connection.isDestroyed()
+            || this.connection.getServer() == null
+            || 
!this.connection.getServer().equals(this.sender.getServerLocation());
+      } finally {
+        getConnectionLifeCycleLock().readLock().unlock();
+      }
+      if (needToReconnect) {
         if (logger.isDebugEnabled()) {

Review comment:
       Does this debug statement need to be moved inside the readLock too since 
it calls `this.connection.getServer()`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> testReplicatedSerialPropagationWithRemoteReceiverRestartedOnOtherNode failure 
> in CI
> -----------------------------------------------------------------------------------
>
>                 Key: GEODE-8706
>                 URL: https://issues.apache.org/jira/browse/GEODE-8706
>             Project: Geode
>          Issue Type: Bug
>            Reporter: John Hutchison
>            Assignee: Xiaojian Zhou
>            Priority: Major
>              Labels: GeodeOperationAPI, pull-request-available
>
> __org.apache.geode.internal.cache.wan.offheap.SerialWANPropagationOffHeapDUnitTest
>  > testReplicatedSerialPropagationWithRemoteReceiverRestartedOnOtherNode 
> FAILED
>  org.apache.geode.test.dunit.RMIException: While invoking 
> org.apache.geode.internal.cache.wan.serial.SerialWANPropagationDUnitTest$$Lambda$181/1328086690.run
>  in VM 4 running on Host 3e4042fb1cd7 with 8 VMs
>  Caused by:
>  org.awaitility.core.ConditionTimeoutException: Assertion condition defined 
> as a lambda expression in org.apache.geode.internal.cache.wan.WANTestBase 
> that uses java.util.Set, java.util.Setint Expected queue entries: 0 but 
> actual entries: 8000 expected:<0> but was:<8000> within 5 minutes.
>  Caused by:
>  java.lang.AssertionError: Expected queue entries: 0 but actual entries: 8000 
> expected:<0> but was:<8000>
>  java.lang.AssertionError: Suspicious strings were written to the log during 
> this run.
>  Fix the strings or use IgnoredException.addIgnoredException to ignore.
>  ----------------------------------------------------------------------
>  Found suspect string in 'dunit_suspect-vm4.log' at line 68
>  [fatal 2020/11/13 18:09:30.989 GMT <AckReaderThread for : Event Processor 
> for GatewaySender_ln> tid=619] Stopping the processor because the following 
> exception occurred while processing a batch: 
>  java.lang.NullPointerException
>  at 
> org.apache.geode.internal.cache.wan.GatewaySenderEventRemoteDispatcher.getConnection(GatewaySenderEventRemoteDispatcher.java:299)
>  at 
> org.apache.geode.internal.cache.wan.GatewaySenderEventRemoteDispatcher.readAcknowledgement(GatewaySenderEventRemoteDispatcher.java:107)
>  at 
> org.apache.geode.internal.cache.wan.GatewaySenderEventRemoteDispatcher$AckReaderThread.run(GatewaySenderEventRemoteDispatcher.java:605)
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to