akasakariko opened a new pull request, #20867: URL: https://github.com/apache/druid/pull/20867
Fixes #20773 ### Description Record the cancellation status when a task is shut down during worker assignment so that a rejected assignment immediately completes the original future as FAILED and removes the task from both pending-task views The assigning thread reads the cancellation status and decides whether to retry under `statusLock`, then completes the cancelled task outside the lock to avoid invoking completion callbacks while holding it Extend the existing in-flight shutdown test to cover both accepted and rejected assignments, including the cancellation reason and release of the worker reservation for another task ### Validation - Reproduced the incomplete future on unpatched master with the rejected-assignment case - `HttpRemoteTaskRunnerTest` and `WorkerHolderTest`: 30 tests, no failures or skips - All indexing-service tests: 3069 tests across the indexing package and remaining metadata and Guice tests, with no failures or errors and 14 pre-existing conditional skips or disabled cases - Checkstyle, PMD, forbidden APIs, Animal Sniffer, Enforcer, SpotBugs and RAT checks pass for indexing-service and its reactor dependencies - Error Prone strict compilation passes for the changed module and its tests - JaCoCo coverage on changed production lines: 90% line coverage and 50% branch coverage, meeting the project thresholds #### Release note Tasks cancelled during worker assignment are promptly marked failed when assignment is rejected, so they no longer inflate pending-task demand until the next storage sync ##### Key changed classes - `HttpRemoteTaskRunner` - `HttpRemoteTaskRunnerTest` This PR has: - [x] been self-reviewed using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) - [x] a release note entry in the PR description - [x] updated existing unit tests to cover the cancellation handoff -- 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]
