You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2018/04/26 10:10:50 UTC

[1/2] lucene-solr:master: LUCENE-8275: Fix BaseLockFactoryTestCase to step out on Windowns if pending files are found

Repository: lucene-solr
Updated Branches:
  refs/heads/master d53de2a38 -> 2265ec194


LUCENE-8275: Fix BaseLockFactoryTestCase to step out on Windowns if pending files are found

The particular test here is #testStressLocks that has several protectesion against
WindowsFS and special logic in the catch clause that steps out on fatal exceptions with
pending deletes. Since we now check this consistently in the IW ctor we need to also
skip this entire test if we are on windows and have pending deletes.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/933d8a69
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/933d8a69
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/933d8a69

Branch: refs/heads/master
Commit: 933d8a6995c03320aa5f3207a107791cc7e9e735
Parents: d53de2a
Author: Simon Willnauer <si...@apache.org>
Authored: Thu Apr 26 11:51:58 2018 +0200
Committer: Simon Willnauer <si...@apache.org>
Committed: Thu Apr 26 12:10:10 2018 +0200

----------------------------------------------------------------------
 .../TestIndexWriterOutOfFileDescriptors.java      |  5 +++++
 .../lucene/store/BaseLockFactoryTestCase.java     | 18 +++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/933d8a69/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
index 290e051..2d2ce8f 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOutOfFileDescriptors.java
@@ -25,6 +25,7 @@ import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.util.Constants;
 import org.apache.lucene.util.LineFileDocs;
 import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems;
 import org.apache.lucene.util.LuceneTestCase;
@@ -65,6 +66,10 @@ public class TestIndexWriterOutOfFileDescriptors extends LuceneTestCase {
         if (ms instanceof ConcurrentMergeScheduler) {
           ((ConcurrentMergeScheduler) ms).setSuppressExceptions();
         }
+        if (Constants.WINDOWS && dir.checkPendingDeletions()) {
+          // if we are on windows and we have pending deletions we can't execute this test
+          break;
+        }
         w = new IndexWriter(dir, iwc);
         if (r != null && random().nextInt(5) == 3) {
           if (random().nextBoolean()) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/933d8a69/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
index 312b644..12f2204 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
@@ -172,11 +172,10 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
     SearcherThread searcher = new SearcherThread(100, dir);
     writer.start();
     searcher.start();
-    
-    while(writer.isAlive() || searcher.isAlive()) {
-      Thread.sleep(1000);
-    }
-    
+
+    writer.join();
+    searcher.join();
+
     assertTrue("IndexWriter hit unexpected exceptions", !writer.hitException);
     assertTrue("IndexSearcher hit unexpected exceptions", !searcher.hitException);
     
@@ -232,14 +231,20 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
         printStream.println("\nTEST: WriterThread iter=" + i);
         iwc.setOpenMode(OpenMode.APPEND);
         try {
+          if (Constants.WINDOWS && dir.checkPendingDeletions()) {
+            // on windows we can potentially have pending deletes here if this happens we step out like in the catch clause
+            // tests using this also assumes no mock window FS
+            break;
+          }
           writer = new IndexWriter(dir, iwc);
+
         } catch (Throwable t) {
           if (Constants.WINDOWS && t instanceof AccessDeniedException) {
             // LUCENE-6684: suppress this: on Windows, a file in the curious "pending delete" state can
             // cause this exc on IW init, where one thread/process deleted an old
             // segments_N, but the delete hasn't finished yet because other threads/processes
             // still have it open
-            printStream.println("TEST: AccessDeniedException on init witer");
+            printStream.println("TEST: AccessDeniedException on init writer");
             t.printStackTrace(printStream);
           } else {
             hitException = true;
@@ -268,7 +273,6 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
             System.out.println(toString(baos));
             break;
           }
-          writer = null;
         }
       }
     }


[2/2] lucene-solr:master: LUCENE-8276: Remove unused imports

Posted by si...@apache.org.
LUCENE-8276: Remove unused imports


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2265ec19
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2265ec19
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2265ec19

Branch: refs/heads/master
Commit: 2265ec1947bb52f7cbb3c3f5c05df66c3e7afa80
Parents: 933d8a6
Author: Simon Willnauer <si...@apache.org>
Authored: Thu Apr 26 11:59:56 2018 +0200
Committer: Simon Willnauer <si...@apache.org>
Committed: Thu Apr 26 12:10:21 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java   | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2265ec19/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
index 82d75a3..373d99a 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
@@ -19,8 +19,6 @@ package org.apache.lucene.spatial3d.geom;
 import java.util.Arrays;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Set;
-import java.util.HashSet;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;