romsharon98 commented on code in PR #40753:
URL: https://github.com/apache/airflow/pull/40753#discussion_r1676065229
##########
airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -546,15 +547,19 @@ def _process_spark_submit_log(self, itr: Iterator[Any])
-> None:
match = re.search("application[0-9_]+", line)
if match:
self._yarn_application_id = match.group(0)
- self.log.info("Identified spark driver id: %s",
self._yarn_application_id)
+ self.log.info("Identified spark application id: %s",
self._yarn_application_id)
# If we run Kubernetes cluster mode, we want to extract the driver
pod id
# from the logs so we can kill the application when we stop it
unexpectedly
elif self._is_kubernetes:
- match = re.search(r"\s*pod name: ((.+?)-([a-z0-9]+)-driver$)",
line)
- if match:
- self._kubernetes_driver_pod = match.group(1)
+ match_driver_pod = re.search(r"\s*pod name:
((.+?)-([a-z0-9]+)-driver$)", line)
+ match_application_id = re.search(r"\s*spark-app-selector ->
(spark-([a-z0-9]+)), ", line)
+ if match_driver_pod:
+ self._kubernetes_driver_pod = match_driver_pod.group(1)
self.log.info("Identified spark driver pod: %s",
self._kubernetes_driver_pod)
+ elif match_application_id:
Review Comment:
We have both driver and application, change it to if
--
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]