YARN-10678. Try blocks without catch blocks in SLS scheduler classes can swallow other exceptions. Contributed by Szilard Nemeth.

This commit is contained in:
Peter Bacsko 2021-03-09 12:03:53 +01:00
parent 20416bc62d
commit ea90cd3556
2 changed files with 6 additions and 0 deletions

View File

@ -119,6 +119,9 @@ public class SLSCapacityScheduler extends CapacityScheduler implements
containerIds, strings,
strings2, updateRequests);
return allocation;
} catch (Exception e) {
LOG.error("Caught exception from allocate", e);
throw e;
} finally {
context.stop();
schedulerMetrics.increaseSchedulerAllocationCounter();

View File

@ -111,6 +111,9 @@ public class SLSFairScheduler extends FairScheduler
schedulingRequests, containerIds,
blacklistAdditions, blacklistRemovals, updateRequests);
return allocation;
} catch (Exception e) {
LOG.error("Caught exception from allocate", e);
throw e;
} finally {
context.stop();
schedulerMetrics.increaseSchedulerAllocationCounter();