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:08:23 UTC

svn commit: r1387540 - in /lucene/dev/branches/lucene_solr_3_6/lucene/contrib/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:08:22 2012
New Revision: 1387540

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

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

Modified: lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java?rev=1387540&r1=1387539&r2=1387540&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java (original)
+++ lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java Wed Sep 19 12:08:22 2012
@@ -830,13 +830,7 @@ public class DirectoryTaxonomyWriter imp
         if (term.field() != Consts.FULL) break;
         cp.clear();
         cp.add(term.text(), 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.seek(term);
         docs.next();
         ordinalMap.addMapping(docs.doc(), ordinal);

Modified: lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java?rev=1387540&r1=1387539&r2=1387540&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java (original)
+++ lucene/dev/branches/lucene_solr_3_6/lucene/contrib/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestAddTaxonomy.java Wed Sep 19 12:08:22 2012
@@ -173,7 +173,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();