janhoy commented on code in PR #3957:
URL: https://github.com/apache/solr/pull/3957#discussion_r2627145664
##########
solr/core/src/test/org/apache/solr/cloud/LeaderElectionTest.java:
##########
@@ -579,23 +581,33 @@ public void run() {
connLossThread.join();
killThread.join();
- int seq = threads.get(getLeaderThread()).getSeq();
+ // Retry getting leader with extended timeout to handle edge cases where
+ // getLeaderUrl() gets an unexpected exception and throws
RuntimeException
+ RetryUtil.retryOnException(
+ Exception.class,
+ 60000, // 60 seconds total timeout
+ 100, // 100ms between retries
+ () -> {
+ int seq = threads.get(getLeaderThread()).getSeq();
+ log.info("Leader election stress test completed, leader seq: {}",
seq);
Review Comment:
Sorry, Copilot, this is not true, the old code fetched seq, but did no extra
validation of it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]