From 6359c1e91d2d6cf3344202339c4f6036507200af Mon Sep 17 00:00:00 2001 From: Hana Snow Date: Fri, 18 Sep 2026 14:59:38 -0400 Subject: [PATCH 1/2] delete dataproc cluster that has entered error state --- .../lib/tasks/dataproc/create_dataproc_cluster.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py b/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py index 33785a8d1e..61e2ea21e2 100644 --- a/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py +++ b/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py @@ -223,6 +223,13 @@ def get_running_cluster(self): if cluster.status.state in FAILURE_STATUSES: msg = f'Cluster {cluster.cluster_name} entered {cluster.status.state.name} state' logger.error(msg) + self.client.delete_cluster( + request={ + 'project_id': Env.GCLOUD_PROJECT, + 'region': Env.GCLOUD_REGION, + 'cluster_name': cluster.cluster_name, + } + ) raise RuntimeError(msg) logger.info('Waiting for cluster spinup') time.sleep(3) From 5e2e9530dc5546d87c584aef47989c1b97696975 Mon Sep 17 00:00:00 2001 From: Hana Snow Date: Fri, 18 Sep 2026 15:02:37 -0400 Subject: [PATCH 2/2] ruff --- loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py b/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py index 61e2ea21e2..dc77765d41 100644 --- a/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py +++ b/loading_pipeline/lib/tasks/dataproc/create_dataproc_cluster.py @@ -228,7 +228,7 @@ def get_running_cluster(self): 'project_id': Env.GCLOUD_PROJECT, 'region': Env.GCLOUD_REGION, 'cluster_name': cluster.cluster_name, - } + }, ) raise RuntimeError(msg) logger.info('Waiting for cluster spinup')