@Override public boolean shouldCountTowardsMaxAttemptRetry() { long attemptFailuresValidityInterval = this.submissionContext .getAttemptFailuresValidityInterval(); long end = System.currentTimeMillis(); if (attemptFailuresValidityInterval > 0 && this.getFinishTime() > 0 && this.getFinishTime() < (end - attemptFailuresValidityInterval)) { return false; } try { this.readLock.lock(); int exitStatus = getAMContainerExitStatus(); return !(exitStatus == ContainerExitStatus.PREEMPTED || exitStatus == ContainerExitStatus.ABORTED || exitStatus == ContainerExitStatus.DISKS_FAILED || exitStatus == ContainerExitStatus.KILLED_BY_RESOURCEMANAGER); } finally { this.readLock.unlock(); } }
@Test public void testExtractYarnResourceManagerAmRetryCountWindowMs() throws Exception { Map<String, String> options = new HashMap<String, String>(); final String expectedInterval = Integer.toString (120000); options.put(ResourceKeys.YARN_RESOURCEMANAGER_AM_RETRY_COUNT_WINDOW_MS, expectedInterval); EasyMock.replay(mockYarnClient, yarnClientApp); appMasterLauncher = new AppMasterLauncher("am1", SliderKeys.APP_TYPE, null, null, mockYarnClient, false, null, options, tags, null); ApplicationSubmissionContext ctx = appMasterLauncher.application .getApplicationSubmissionContext(); String retryIntervalWindow = Long.toString(ctx .getAttemptFailuresValidityInterval()); Assert.assertEquals(expectedInterval, retryIntervalWindow); }
@Test public void testExtractYarnResourceManagerAmRetryCountWindowMs() throws Exception { Map<String, String> options = new HashMap<String, String>(); final String expectedInterval = Integer.toString (120000); options.put(ResourceKeys.YARN_RESOURCEMANAGER_AM_RETRY_COUNT_WINDOW_MS, expectedInterval); EasyMock.replay(mockYarnClient, yarnClientApp); appMasterLauncher = new AppMasterLauncher("am1", SliderKeys.APP_TYPE, null, null, mockYarnClient, false, null, options, tags, null); ApplicationSubmissionContext ctx = appMasterLauncher.application .getApplicationSubmissionContext(); String retryIntervalWindow = Long.toString(ctx .getAttemptFailuresValidityInterval()); Assert.assertEquals(expectedInterval, retryIntervalWindow); }
@Test public void testExtractYarnResourceManagerAmRetryCountWindowMsDefaultValue() throws Exception { Map<String, String> options = new HashMap<String, String>(); EasyMock.replay(mockYarnClient, yarnClientApp); appMasterLauncher = new AppMasterLauncher("am1", SliderKeys.APP_TYPE, null, null, mockYarnClient, false, null, options, tags, null); ApplicationSubmissionContext ctx = appMasterLauncher.application .getApplicationSubmissionContext(); long retryIntervalWindow = ctx.getAttemptFailuresValidityInterval(); Assert.assertEquals(ResourceKeys.DEFAULT_AM_RETRY_COUNT_WINDOW_MS, retryIntervalWindow); }
submissionContext.getAttemptFailuresValidityInterval(); if (this.attemptFailuresValidityInterval > 0) { LOG.info("The attemptFailuresValidityInterval for the application: "
@Test public void testExtractYarnResourceManagerAmRetryCountWindowMsDefaultValue() throws Exception { Map<String, String> options = new HashMap<String, String>(); EasyMock.replay(mockYarnClient, yarnClientApp); appMasterLauncher = new AppMasterLauncher("am1", SliderKeys.APP_TYPE, null, null, mockYarnClient, false, null, options, tags, null); ApplicationSubmissionContext ctx = appMasterLauncher.application .getApplicationSubmissionContext(); long retryIntervalWindow = ctx.getAttemptFailuresValidityInterval(); Assert.assertEquals(ResourceKeys.DEFAULT_AM_RETRY_COUNT_WINDOW_MS, retryIntervalWindow); }
submissionContext.getAttemptFailuresValidityInterval(); if (this.attemptFailuresValidityInterval > 0) { LOG.info("The attemptFailuresValidityInterval for the application: "
submissionContext.getAttemptFailuresValidityInterval(); if (this.attemptFailuresValidityInterval > 0) { LOG.info("The attemptFailuresValidityInterval for the application: "
); context.setAttemptFailuresValidityInterval( oldAppSubCtxt.getAttemptFailuresValidityInterval()); context.setKeepContainersAcrossApplicationAttempts( oldAppSubCtxt.getKeepContainersAcrossApplicationAttempts());