Fix issues when startup timeout is hit (#14425)

This commit is contained in:
George Shiqi Wu 2023-06-14 14:49:55 -04:00 committed by GitHub
parent 6fd28fc185
commit 76e70654ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -124,6 +124,11 @@ public class KubernetesPeonLifecycle
return join(timeout);
}
catch (Exception e) {
log.info("Failed to run task: %s", taskId.getOriginalTaskId());
shutdown();
throw e;
}
finally {
state.set(State.STOPPED);
}

View File

@ -163,7 +163,9 @@ public class KubernetesPeonLifecycleTest extends EasyMockSupport
EasyMock.anyLong(),
EasyMock.eq(TimeUnit.MILLISECONDS)
)).andReturn(null);
EasyMock.expect(kubernetesClient.deletePeonJob(
new K8sTaskId(ID)
)).andReturn(true);
Assert.assertEquals(KubernetesPeonLifecycle.State.NOT_STARTED, peonLifecycle.getState());
replayAll();