kaxil commented on code in PR #67715:
URL: https://github.com/apache/airflow/pull/67715#discussion_r3325824366
##########
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -682,10 +730,17 @@ def _process_spark_submit_log(self, itr: Iterator[Any])
-> None:
# 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:
+ # Two log formats exist across Spark versions:
+ # "pod name: <name>-driver" and "submission ID
spark:<name>-driver"
match_driver_pod = re.search(r"\s*pod name:
((.+?)-([a-z0-9]+)-driver$)", 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)
+ if not self._kubernetes_driver_pod:
+ match_submission_id = re.search(r"submission ID
spark:(.+-driver)", line)
Review Comment:
`(.+-driver)` is greedy and will grab to the last `-driver` if an app name
ever contains that substring. `(.+?-driver)` is safer.
--
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]