uranusjr commented on code in PR #68048:
URL: https://github.com/apache/airflow/pull/68048#discussion_r3975854064
##########
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -1232,7 +1239,52 @@ def _poll_k8s_driver_via_api(self) -> str | None:
) from e
time.sleep(poll_interval)
continue
-
+ driver_container = None
+
+ for container in pod.spec.containers:
+ if kubernetes_driver_container_name:
+ if kubernetes_driver_container_name.lower() ==
container.name.lower():
+ driver_container = container
+ break
+ continue
+ if "driver" in container.name.lower():
+ driver_container = container
+ break
+ if "spark" in container.name.lower():
+ driver_container = container
+ if len(pod.spec.containers) == 1:
+ driver_container = container
+ if kubernetes_driver_container_name and not driver_container:
+ raise ValueError(
+ f"The driver container name provided does not match
any of the containers in pod {kubernetes_driver_pod_name}"
+ )
Review Comment:
This raises from inside the poll loop, so it `skips _delete_driver_pod()`
after the loop. The task fails while the driver pod and the Spark application
keep running, with no cleanup and no recorded external id to reconnect to.
`_poll_k8s_driver_via_api` runs after submission, so the job is already live by
the time the typo is discovered.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]