You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/01 19:29:07 UTC

[GitHub] [pulsar] merlimat opened a new pull request #11886: Fixed ZKSessionTest.testReacquireLocksAfterSessionLost

merlimat opened a new pull request #11886:
URL: https://github.com/apache/pulsar/pull/11886


   ### Motivation
   
   Fixes the flakiness in `ZKSessionTest.testReacquireLocksAfterSessionLost` test:
   
   ```
   Error:  testReacquireLocksAfterSessionLost(org.apache.pulsar.metadata.ZKSessionTest)  Time elapsed: 22.547 s  <<< FAILURE!
   java.lang.AssertionError: expected [Reconnected] but found [null]
   	at org.testng.Assert.fail(Assert.java:99)
   	at org.testng.Assert.failNotEquals(Assert.java:1037)
   	at org.testng.Assert.assertEqualsImpl(Assert.java:140)
   	at org.testng.Assert.assertEquals(Assert.java:122)
   	at org.testng.Assert.assertEquals(Assert.java:617)
   	at org.apache.pulsar.metadata.ZKSessionTest.testReacquireLocksAfterSessionLost(ZKSessionTest.java:126)
   ```
   
   The root cause for the test failing is that, when the session is forcefully expired, we're also getting a watch triggered for the deletion of the ephemeral node.  That means that, depending on the timing of the watch, we can end up trying to revalidate the lock while we're not connected to ZK. 
   
   When that happens, we should expire the lock, instead we only expire it if we get a BadVersion on the put operation, which means that someone else took the lock over.
   
   This way, we can retry the validation when we're finally reconnected to ZK.
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] lhotari merged pull request #11886: Fixed ZKSessionTest.testReacquireLocksAfterSessionLost

Posted by GitBox <gi...@apache.org>.
lhotari merged pull request #11886:
URL: https://github.com/apache/pulsar/pull/11886


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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