Skip to content

Commit

Permalink
Make thread a daemon thread, and fix test until curator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HoustonPutman committed Oct 25, 2024
1 parent 5a76cd0 commit 31ebd14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion solr/core/src/java/org/apache/solr/cloud/Overseer.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ public void run() {
log.info("Overseer Loop exiting : {}", LeaderElector.getNodeName(myId));
}
// do this in a separate thread because any wait is interrupted in this main thread
new Thread(this::checkIfIamStillLeader, "OverseerExitThread").start();
Thread checkLeaderThread = new Thread(this::checkIfIamStillLeader, "OverseerExitThread");
checkLeaderThread.setDaemon(true);
checkLeaderThread.start();
}
}

Expand Down
4 changes: 4 additions & 0 deletions solr/core/src/test/org/apache/solr/cloud/ZkFailoverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.apache.solr.cloud;

import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
import java.lang.invoke.MethodHandles;
import org.apache.solr.SolrIgnoredThreadsFilter;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.request.QueryRequest;
Expand All @@ -31,6 +33,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// Can be removed once CURATOR-720 is resolved, and the dependency is updated
@ThreadLeakFilters(filters = {SolrIgnoredThreadsFilter.class})
public class ZkFailoverTest extends SolrCloudTestCase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public boolean reject(Thread t) {
return true;
}

// CURATOR-720
if (threadName.equals("OverseerExitThread")) {
return true;
}

return threadName.startsWith("closeThreadPool");
}
}

0 comments on commit 31ebd14

Please sign in to comment.