gaobinlong commented on code in PR #15574:
URL: https://github.com/apache/lucene/pull/15574#discussion_r3271573433


##########
lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java:
##########
@@ -277,28 +293,31 @@ private FirstPassGroupingCollector<?> 
createRandomFirstPassCollector(
       String groupField, Sort groupSort, int topDocs) throws IOException {
     if (random().nextBoolean()) {
       ValueSource vs = new BytesRefFieldSource(groupField);
-      return new FirstPassGroupingCollector<>(
-          new ValueSourceGroupSelector(vs, new HashMap<>()), groupSort, 
topDocs);
+      Map<Object, Object> context = new HashMap<>();

Review Comment:
   > We probably don't see failures because it's always empty in your testing?
   
   I think that's because we only use ByteRefFieldValueSource and the context 
is never be used actually, see:
   
https://github.com/apache/lucene/blob/1ca725763e910c5ae3f6f6ec9fabb4b1dc6bc8be/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/BytesRefFieldSource.java#L41
   
   , but for other ValueSource, it may write the context in getValues() so it's 
not thread-safe.
   
   Changed it backed to one map per collector.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to