From 084c8d6ca59707519a8c23e01d5d20bde49fcccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20H=C3=BCther?= Date: Tue, 25 Jan 2022 17:16:26 +0100 Subject: [PATCH] k8s executor: throw NodeTerminationException on node shutdown (#2590) Signed-off-by: phue --- .../src/main/groovy/nextflow/k8s/client/K8sClient.groovy | 2 +- .../src/test/groovy/nextflow/k8s/client/K8sClientTest.groovy | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.groovy b/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.groovy index f7b46ec37f..3ebbd9d8ca 100644 --- a/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/k8s/client/K8sClient.groovy @@ -209,7 +209,7 @@ class K8sClient { // this may happen when K8s node is shutdown and the pod is evicted // therefore process exception is thrown so that the failure // can be managed by the nextflow as re-triable execution - throw new ProcessFailedException("Unable to find pod $name - The pod may be evicted by a node shutdown event") + throw new NodeTerminationException("Unable to find pod $name - The pod may be evicted by a node shutdown event") } throw err } diff --git a/modules/nextflow/src/test/groovy/nextflow/k8s/client/K8sClientTest.groovy b/modules/nextflow/src/test/groovy/nextflow/k8s/client/K8sClientTest.groovy index bfedc7d703..bb720ac3ad 100644 --- a/modules/nextflow/src/test/groovy/nextflow/k8s/client/K8sClientTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/k8s/client/K8sClientTest.groovy @@ -20,7 +20,6 @@ package nextflow.k8s.client import javax.net.ssl.HttpsURLConnection import nextflow.exception.NodeTerminationException -import nextflow.exception.ProcessFailedException import spock.lang.Specification /** * @@ -499,7 +498,7 @@ class K8sClientTest extends Specification { 1 * client.podStatus(POD_NAME) >> { throw new K8sResponseException("Request GET /api/v1/namespaces/xyz/pods/nf-xyz/status returned an error code=404", new ByteArrayInputStream(JSON.bytes)) } and: - thrown(ProcessFailedException) + thrown(NodeTerminationException) } def 'should fail to get pod state' () {