Repository: hadoop Updated Branches: refs/heads/branch-3.0 ba9a656ff -> 7c286fe80
YARN-7636. Re-reservation count may overflow when cluster resource exhausted for a long time. contributed by Tao Yang. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7c286fe8 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7c286fe8 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7c286fe8 Branch: refs/heads/branch-3.0 Commit: 7c286fe8045a6b343173d82870eeaf45e5ed0086 Parents: ba9a656 Author: Weiwei Yang <[email protected]> Authored: Fri Mar 16 18:57:31 2018 +0800 Committer: Weiwei Yang <[email protected]> Committed: Fri Mar 16 19:11:54 2018 +0800 ---------------------------------------------------------------------- .../scheduler/SchedulerApplicationAttempt.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c286fe8/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java index 3f2a37b..15e6ea6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java @@ -401,7 +401,11 @@ public class SchedulerApplicationAttempt implements SchedulableEntity { protected void addReReservation( SchedulerRequestKey schedulerKey) { - reReservations.add(schedulerKey); + try { + reReservations.add(schedulerKey); + } catch (IllegalArgumentException e) { + // This happens when count = MAX_INT, ignore the exception + } } public int getReReservations(SchedulerRequestKey schedulerKey) { @@ -932,8 +936,13 @@ public class SchedulerApplicationAttempt implements SchedulableEntity { public int addMissedNonPartitionedRequestSchedulingOpportunity( SchedulerRequestKey schedulerKey) { - return missedNonPartitionedReqSchedulingOpportunity.add( - schedulerKey, 1) + 1; + try { + return missedNonPartitionedReqSchedulingOpportunity.add( + schedulerKey, 1) + 1; + } catch (IllegalArgumentException e) { + // This happens when count = MAX_INT, ignore the exception + return Integer.MAX_VALUE; + } } public void --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
