You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
This PR makes FairScheduler preemption tracking thread-safe by synchronizing mutable access in FSPreemptionThread.
Change
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSPreemptionThread.java: synchronize PreemptableContainers mutation and iteration so concurrent preemption bookkeeping cannot hit ConcurrentModificationException.
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSPreemptionThread.java: add a regression test that hammers concurrent add and iterate access.
Earlier commands above are historical evidence, where present. Current rebase validation passed git diff --check; fresh hosted CI is running. Focused Java validation is reported separately when complete.
Validated repair head 08439e84 (2026-09-19)
The concurrency regression passes in a Java 17/Maven 3.9.15 container (1 test, no failures or errors).
mvn -B -ntp -pl hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager -am -Dtest=TestFSPreemptionThread -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false test
The reactor completed successfully and Surefire reported 1 tests, 0 failures, 0 errors, 0 skipped. git diff --check also passes. Hosted CI for this head remains separate.
Rebased on trunk and made the preemption container tracker thread-safe. Added a regression test for concurrent add/iterate access in the fair scheduler helper. Local Maven validation hit unrelated repository/network dependency issues in this environment, so I’m ready for CI.
CI is green on the current head, and this one still has not had a human review. @adoroszlai, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head. @adoroszlai already noted this needs a YARN reviewer, so @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head, and this one is still waiting on a YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head, and this one is still waiting on YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head, and this one is still waiting on a YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head, and this one is still waiting on a YARN review as of July 20, 2026. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head as of July 26, 2026, and this one is still waiting on YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head as of July 29, 2026, and this one is still waiting on YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head as of August 4, 2026, and this one is still waiting on a YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head as of August 7, 2026, and this one is still waiting on a YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
CI is still green on the current head as of August 10, 2026, and this one is still waiting on a YARN review. @wangda@sunilg, when you have a moment, could you please take a look? Happy to make any follow-up changes.
Hi @pan3793@steveloughran@slfan1989, YARN-11851 has been waiting since March. Branch is current on trunk and the preemption thread fix has unit tests. Would appreciate a review when you have a few minutes.
Rebased cleanly onto current trunk at 706d4dcb. git diff --check apache/trunk...origin/YARN-11851-threadsafe-hashmap passes. This host currently has no Java runtime or Maven, so I could not rerun the focused Maven test here; fresh Build and Jenkins checks are queued on 0816b8fe. Ready for CI.
Rebased onto trunk a3febb25 and pushed 08439e84 to the fork. The concurrency regression passes in a Java 17/Maven 3.9.15 container (1 test, no failures or errors). git diff --check passes; fresh hosted CI is running.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes FairScheduler preemption tracking thread-safe by synchronizing mutable access in
FSPreemptionThread.Change
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSPreemptionThread.java: synchronizePreemptableContainersmutation and iteration so concurrent preemption bookkeeping cannot hitConcurrentModificationException.hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/TestFSPreemptionThread.java: add a regression test that hammers concurrent add and iterate access.JIRA
Fixes YARN-11851
For code changes:
AI Tooling
Contains content generated by Codex.
How was this patch tested?
Earlier commands above are historical evidence, where present. Current rebase validation passed
git diff --check; fresh hosted CI is running. Focused Java validation is reported separately when complete.Validated repair head
08439e84(2026-09-19)The concurrency regression passes in a Java 17/Maven 3.9.15 container (1 test, no failures or errors).
mvn -B -ntp -pl hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager -am -Dtest=TestFSPreemptionThread -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false testThe reactor completed successfully and Surefire reported 1 tests, 0 failures, 0 errors, 0 skipped.
git diff --checkalso passes. Hosted CI for this head remains separate.