YARN-3917. getResourceCalculatorPlugin for the default should intercept all exceptions. (gera)

This commit is contained in:
Gera Shegalov 2015-07-10 17:43:53 -07:00
parent 1df39c1efc
commit d7319dee37
2 changed files with 10 additions and 2 deletions

View File

@ -616,6 +616,9 @@ Release 2.8.0 - UNRELEASED
YARN-3849. Too much of preemption activity causing continuos killing of YARN-3849. Too much of preemption activity causing continuos killing of
containers across queues. (Sunil G via wangda) containers across queues. (Sunil G via wangda)
YARN-3917. getResourceCalculatorPlugin for the default should intercept all
exceptions. (gera)
Release 2.7.2 - UNRELEASED Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -17,6 +17,8 @@
*/ */
package org.apache.hadoop.yarn.util; package org.apache.hadoop.yarn.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
@ -30,6 +32,8 @@
@InterfaceAudience.LimitedPrivate({"YARN", "MAPREDUCE"}) @InterfaceAudience.LimitedPrivate({"YARN", "MAPREDUCE"})
@InterfaceStability.Unstable @InterfaceStability.Unstable
public class ResourceCalculatorPlugin extends Configured { public class ResourceCalculatorPlugin extends Configured {
private static final Log LOG =
LogFactory.getLog(ResourceCalculatorPlugin.class);
private final SysInfo sys; private final SysInfo sys;
@ -158,9 +162,10 @@ public static ResourceCalculatorPlugin getResourceCalculatorPlugin(
} }
try { try {
return new ResourceCalculatorPlugin(); return new ResourceCalculatorPlugin();
} catch (SecurityException e) { } catch (Throwable t) {
return null; LOG.warn(t + ": Failed to instantiate default resource calculator.", t);
} }
return null;
} }
} }