You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2012/09/19 14:15:20 UTC

svn commit: r1387542 - in /lucene/dev/trunk/lucene/facet/src: java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java

Author: shaie
Date: Wed Sep 19 12:15:20 2012
New Revision: 1387542

URL: http://svn.apache.org/viewvc?rev=1387542&view=rev
Log:
LUCENE-4402: TestAddTaxonomy.testConcurrency failure (trunk)

Modified:
    lucene/dev/trunk/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java
    lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java

Modified: lucene/dev/trunk/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java?rev=1387542&r1=1387541&r2=1387542&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java (original)
+++ lucene/dev/trunk/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java Wed Sep 19 12:15:20 2012
@@ -856,13 +856,7 @@ public class DirectoryTaxonomyWriter imp
           String value = te.term().utf8ToString();
           cp.clear();
           cp.add(value, Consts.DEFAULT_DELIMITER);
-          int ordinal = findCategory(cp);
-          if (ordinal < 0) {
-            // NOTE: call addCategory so that it works well in a multi-threaded
-            // environment, in case e.g. a thread just added the category, after
-            // the findCategory() call above failed to find it.
-            ordinal = addCategory(cp);
-          }
+          final int ordinal = addCategory(cp);
           docs = te.docs(null, docs, 0);
           ordinalMap.addMapping(docs.nextDoc() + base, ordinal);
         }

Modified: lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java?rev=1387542&r1=1387541&r2=1387542&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java (original)
+++ lucene/dev/trunk/lucene/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java Wed Sep 19 12:15:20 2012
@@ -191,7 +191,7 @@ public class TestAddTaxonomy extends Luc
 
   public void testConcurrency() throws Exception {
     // tests that addTaxonomy and addCategory work in parallel
-    final int numCategories = atLeast(5000);
+    final int numCategories = atLeast(10000);
     
     // build an input taxonomy index
     Directory src = newDirectory();