Skip to content

Commit e58fc91

Browse files
author
Marcelo Vanzin
committed
Feedback.
1 parent 29f1436 commit e58fc91

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

launcher/src/main/java/org/apache/spark/launcher/ChildProcAppHandle.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@ public synchronized void disconnect() {
4949

5050
/**
5151
* Parses the logs of {@code spark-submit} and returns the last exception thrown.
52-
*
5352
* <p>
54-
* Since {@link SparkLauncher} runs {@code spark-submit} in a sub-process, its difficult to
55-
* accurately retrieve the full {@link Throwable} from the {@code spark-submit} process.
56-
* This method parses the logs of the sub-process and provides a best-effort attempt at
57-
* returning the last exception thrown by the {@code spark-submit} process. Only the exception
58-
* message is parsed, the associated stacktrace is meaningless.
59-
* </p>
53+
* Since {@link SparkLauncher} runs {@code spark-submit} in a sub-process, it's difficult to
54+
* accurately retrieve the full {@link Throwable} from the {@code spark-submit} process.
55+
* This method parses the logs of the sub-process and provides a best-effort attempt at
56+
* returning the last exception thrown by the {@code spark-submit} process. Only the exception
57+
* message is parsed, the associated stacktrace is meaningless.
6058
*
6159
* @return an {@link Optional} containing a {@link RuntimeException} with the parsed
6260
* exception, otherwise returns a {@link Optional#EMPTY}

launcher/src/main/java/org/apache/spark/launcher/OutputRedirector.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ private void redirect() {
6262
while ((line = reader.readLine()) != null) {
6363
if (active) {
6464
sink.info(line.replaceFirst("\\s*$", ""));
65-
if (error == null && containsIgnoreCase(line, "Error") || containsIgnoreCase(line,
66-
"Exception")) {
65+
if (containsIgnoreCase(line, "Error") || containsIgnoreCase(line, "Exception")) {
6766
error = new RuntimeException(line);
6867
}
6968
}

0 commit comments

Comments
 (0)