abernardi597 commented on PR #16778: URL: https://github.com/apache/lucene/pull/16778#issuecomment-7110291721
Pushed a new revision, and updated the description. Since #16794, most of a merge's work runs in the join phases, which the previous revision did not touch, so recruitment now lives in a `runInBatches` helper that every phase uses. Sorry the previous push did not compile: #16794 added a `tasks` local in the same scope, which the rebase could not flag. @kaivalnp, on `tryInvoke` only rejecting tasks that start immediately: I narrowed the contract so deferral no longer needs detecting. `tryInvoke` declines only when the executor would run the task on the calling thread before it returns. A forked task may start later on any thread, and cancelling its future skips it if it has not started, reusing `TaskExecutor.Task`. So the caller holds the shared context you suggested: once it runs out of batches, it cancels the workers it forked and waits only for those another thread started. If you'd rather keep `TaskExecutor`'s API smaller, the builder could own the decline check instead; I'm happy to go either way. @LantaoJin, this reworks the join phases from #16794 slightly: `runInBatches` now takes the batch size, which `joinBatchSize` computes as before. I'd appreciate a look. -- 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]
