amoghrajesh commented on code in PR #70513:
URL: https://github.com/apache/airflow/pull/70513#discussion_r3657325687


##########
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -885,7 +889,11 @@ def _process_spark_submit_log(self, itr: Iterator[Any]) -> 
None:
                     self._driver_id = match_driver_id.group(0)
                     self.log.info("identified spark driver id: %s", 
self._driver_id)
 
-            self._last_submit_log_lines.append(line)
+            if self._exception_anchor_seen:
+                self._last_submit_log_lines.append(line)
+            elif _EXCEPTION_START_RE.search(line):
+                self._exception_anchor_seen = True
+                self._last_submit_log_lines.append(line)

Review Comment:
   Verified against Spark 3.5.3 source before applying: `PythonRunner.scala` 
throws `SparkUserAppException` on a nonzero Python exit, and `SparkSubmit's` 
`ClassNotFoundException` handler does the same for a bad --class both caught by 
doSubmit's override and exited via exitFn(), so neither ever prints Exception 
in thread. Fair catch. Applied as suggested.
   
   



-- 
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]

Reply via email to