madrob commented on a change in pull request #2291:
URL: https://github.com/apache/lucene-solr/pull/2291#discussion_r569771526



##########
File path: 
solr/core/src/java/org/apache/solr/cluster/events/impl/DelegatingClusterEventProducer.java
##########
@@ -90,7 +101,11 @@ public void setDelegate(ClusterEventProducer newDelegate) {
         log.debug("--- delegate {} already in state {}", delegate, 
delegate.getState());
       }
     }
-    this.version++;
+    Phaser localPhaser = phaser; // volatile read
+    if (localPhaser != null) {
+      assert localPhaser.getRegisteredParties() == 1;
+      localPhaser.arrive(); // we should be the only ones registered, so this 
will advance phase each time

Review comment:
       In the JIRA issue you specifically suggested "maybe the test can provide 
a latch" which would be a specific synchronization implementation, but a latch 
happened to be insufficient because we need something that can block for us 
multiple times. I don't see this as too divergent from that idea, and have seen 
other code available for injecting latches specifically. It feels the same.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to