You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/04/22 12:17:36 UTC

[GitHub] [lucene-solr] s1monw commented on a change in pull request #1443: LUCENE-9337: Ensure CMS updates it's thread accounting datastructures consistently

s1monw commented on a change in pull request #1443:
URL: https://github.com/apache/lucene-solr/pull/1443#discussion_r412930075



##########
File path: lucene/core/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
##########
@@ -657,4 +659,88 @@ protected void doStall() {
 
     assertFalse(failed.get());
   }
+
+  /*
+   * This test tries to produce 2 merges running concurrently with 2 segments per merge. While these
+   * merges run we kick off a forceMerge that puts a pending merge in the queue but waits for things to happen.
+   * While we do this we reduce maxMergeCount to 1. If concurrency in CMS is not right the forceMerge will wait forever
+   * since non of the currently running merges picks up the pending merge. This test fails every
+   */
+  public void testChangeMaxMergeCountyWhileForceMerge() throws IOException, InterruptedException {
+    int numIters = TEST_NIGHTLY ? 100 : 10;
+    for (int iters = 0; iters < numIters; iters++) {
+      LogDocMergePolicy mp = new LogDocMergePolicy();
+      mp.setMergeFactor(2);
+      CountDownLatch forceMergeWaits = new CountDownLatch(1);
+      CountDownLatch mergeThreadsStartAfterWait = new CountDownLatch(1);
+      CountDownLatch mergeThreadsArrived = new CountDownLatch(2);
+      InfoStream stream = new InfoStream() {
+        @Override
+        public void message(String component, String message) {

Review comment:
       yeah I take whatever I get in these cases :D




----------------------------------------------------------------
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:
users@infra.apache.org



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