File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lucene/facet/src/java/org/apache/lucene/facet Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1919import java .io .IOException ;
2020import java .util .ArrayList ;
2121import java .util .Arrays ;
22+ import java .util .Collections ;
2223import java .util .Comparator ;
2324import java .util .List ;
2425import java .util .Objects ;
@@ -65,12 +66,15 @@ class DrillSidewaysQuery extends Query {
6566 FacetsCollectorManager [] drillSidewaysCollectorManagers ,
6667 Query [] drillDownQueries ,
6768 boolean scoreSubDocsAtOnce ) {
69+ // Note that the "managed" facet collector lists are synchronized here since bulkScorer()
70+ // can be invoked concurrently and needs to remain thread-safe. We're OK with synchronizing
71+ // on the whole list as contention is expected to remain very low:
6872 this (
6973 baseQuery ,
7074 drillDownCollectorManager ,
7175 drillSidewaysCollectorManagers ,
72- new ArrayList <>(),
73- new ArrayList <>(),
76+ Collections . synchronizedList ( new ArrayList <>() ),
77+ Collections . synchronizedList ( new ArrayList <>() ),
7478 drillDownQueries ,
7579 scoreSubDocsAtOnce );
7680 }
You can’t perform that action at this time.
0 commit comments