lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1670587 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/index/ lucene/core/src/test/org/apache/lucene/index/
Date Wed, 01 Apr 2015 09:28:18 GMT
Author: mikemccand
Date: Wed Apr  1 09:28:18 2015
New Revision: 1670587

URL: http://svn.apache.org/r1670587
Log:
LUCENE-6381: defensively wait for a limited time during DWPT stall

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterStallControl.java
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java

Modified: lucene/dev/branches/branch_5x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/CHANGES.txt?rev=1670587&r1=1670586&r2=1670587&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Wed Apr  1 09:28:18 2015
@@ -23,6 +23,7 @@ Bug Fixes
 
 * LUCENE-6378: Fix all RuntimeExceptions to throw the underlying root cause.
   (Varun Thacker, Adrien Grand, Mike McCandless)
+
 ======================= Lucene 5.1.0 =======================
 
 New Features
@@ -77,6 +78,10 @@ Bug Fixes
   toString method of IndexInputs confess when they are from a compound
   file. (Robert Muir, Mike McCandless)
 
+* LUCENE-6381: Add defensive wait time limit in
+  DocumentsWriterStallControl to prevent hangs during indexing if we
+  miss a .notify/All somewhere (Mike McCandless)
+
 Optimizations
 
 * LUCENE-6183, LUCENE-5647: Avoid recompressing stored fields

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterStallControl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterStallControl.java?rev=1670587&r1=1670586&r2=1670587&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterStallControl.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterStallControl.java
Wed Apr  1 09:28:18 2015
@@ -77,7 +77,9 @@ final class DocumentsWriterStallControl
           // don't loop here, higher level logic will re-stall!
           try {
             incWaiters();
-            wait();
+            // Defensive, in case we have a concurrency bug that fails to .notify/All our
thread:
+            // just wait for up to 1 second here, and let caller re-stall if it's still needed:
+            wait(1000);
             decrWaiters();
           } catch (InterruptedException e) {
             throw new ThreadInterruptedException(e);

Modified: lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java?rev=1670587&r1=1670586&r2=1670587&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterStallControl.java
Wed Apr  1 09:28:18 2015
@@ -46,7 +46,7 @@ public class TestDocumentsWriterStallCon
     ctrl.updateStalled(true);
     waitThreads = waitThreads(atLeast(1), ctrl);
     start(waitThreads);
-    awaitState(Thread.State.WAITING, waitThreads);
+    awaitState(Thread.State.TIMED_WAITING, waitThreads);
     assertTrue(ctrl.hasBlocked());
     assertTrue(ctrl.anyStalledThreads());
     ctrl.updateStalled(false);



Mime
View raw message