reugn opened a new pull request, #16973:
URL: https://github.com/apache/lucene/pull/16973

   When one slice of a concurrent search throws, `TaskExecutor` cancels the 
slices that have not started yet, but the running ones keep scoring until they 
finish, although their results are thrown away. In a repro with 8 slices and a 
slow collector, the failure reached the caller after 1012 ms on `main` and 
after 5 ms with this change.
   
   This change gives each `invokeAll` call a `TaskGroup` that is marked as 
failed when one of its tasks fails. The group is bound to the running task 
through a `ScopedValue`, so `IndexSearcher#searchLeaf` can check it without API 
changes. For multi-slice searches, `searchLeaf` checks the group before each 
leaf and while scoring through `TimeLimitingBulkScorer`, as suggested in 
#12278. The caller still gets only the original exception, and `timedOut()` is 
not affected.
   
   Unlike #12756, nothing is stored on `IndexSearcher`, so a failure can't 
affect other searches on the same searcher.
   
   Multi-slice searches now score in chunks even without a timeout. JMH showed 
no difference for term, disjunction and conjunction queries, and a fixed +1.6 
µs for a match-all count, about the same as setting a no-op timeout on `main`.
   
   `searchLeaf` can now throw a `CancellationException` once another slice 
failed, which is documented on the method. `ScopedValue` became final in JDK 
25, so this targets `main` only. The per-leaf KNN tasks have the same gap and 
can follow separately.
   
   Closes #12278


-- 
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