dongjoon-hyun opened a new pull request, #58970: URL: https://github.com/apache/spark/pull/58970
### What changes were proposed in this pull request? This PR moves `rootPool.executorDecommission(executorId)` inside the `synchronized` block that `TaskSchedulerImpl.executorDecommission()` already has, keeping `backend.reviveOffers()` outside it. ### Why are the changes needed? `rootPool.executorDecommission()` reaches `TaskSetManager.recomputeLocality()`, and `TaskSchedulerImpl` documents that "TaskSetManagers are not thread safe, so any access to one should be synchronized on this class". The sibling `executorLost()` path already follows this: it calls `rootPool.executorLost()` inside the lock and keeps only the `dagScheduler` and `backend` calls outside. This makes the two paths consistent. There is no behavior change. The only production caller, `CoarseGrainedSchedulerBackend.decommissionExecutors()`, is `withLock`, which already holds this same monitor, so the call was effectively synchronized in practice. This PR makes the method self-contained instead of relying on its caller. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5 -- 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]
