Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-35234][CORE] Reserve the format of stage failureMessage #32356

Closed
wants to merge 3 commits into from

Conversation

Ngone51
Copy link
Member

@Ngone51 Ngone51 commented Apr 27, 2021

What changes were proposed in this pull request?

failureMessage is already formatted, but replaceAll("\n", " ") destroyed the format. This PR fixed it.

Why are the changes needed?

The formatted error message is easier to read and debug.

Does this PR introduce any user-facing change?

Yes, users see the clear error message in the application log.

(Note I changed a little bit to let the test throw exception intentionally. The test itself is good.)

Before:
2141619490903_ pic_hd

After:

2151619490955_ pic_hd

How was this patch tested?

Manually tested.

@github-actions github-actions bot added the CORE label Apr 27, 2021
@Ngone51
Copy link
Member Author

Ngone51 commented Apr 27, 2021

cc @mridulm @tgravescs @attilapiros

@attilapiros
Copy link
Contributor

attilapiros commented Apr 27, 2021

There is another case of using replaceAll on the message:

""".stripMargin.replaceAll("\n", " ")

What about fixing that one too?

@Ngone51
Copy link
Member Author

Ngone51 commented Apr 27, 2021

SGTM

|Most recent failure reason: $message
""".stripMargin.replaceAll("\n", " ")
s"$failedStage (${failedStage.name}) has failed the maximum allowable number of " +
s"times: $maxConsecutiveStageAttempts. Most recent failure reason: $message"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we don't append \n for this "Most recent failure reason" because message already contains it:

val message = s"Stage failed because barrier task $task finished unsuccessfully.\n" +
  failure.toErrorString

@attilapiros
Copy link
Contributor

@Ngone51 the images you attached to the PR description are the logs of a running test?
If yes that would be not a user-facing change but a developer-facing one :)

But I think these messages are landing on the UI and those should be attached to the PR description.

@Ngone51
Copy link
Member Author

Ngone51 commented Apr 27, 2021

Yes, the screenshot is from a test. It's for convenient purpose. But the stage failure is shown to users directly, right? So I consider it a user-facing change.

Attach UI changes sounds like better idea, which is surely a user-facing change. I'll try.

@Ngone51
Copy link
Member Author

Ngone51 commented Apr 27, 2021

@attilapiros I have done the experiment on UI. And it turns out that the format in UI is always correct. That's because we passed the formatted failureMessage to UI directly without any change. You could check the related code there:

markStageAsFinished(failedStage, errorMessage = Some(failureMessage),

@SparkQA
Copy link

SparkQA commented Apr 27, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42497/

@SparkQA
Copy link

SparkQA commented Apr 27, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42497/

@attilapiros
Copy link
Contributor

The description would be perfect with the UI screenshot and it would be so good to take a look how the message is actually rendered on UI.

@Ngone51 So I would like to kindly ask you to make those screenshots (before and after) by for example doing a temporarily code change!

@SparkQA
Copy link

SparkQA commented Apr 27, 2021

Test build #137977 has finished for PR 32356 at commit 0896255.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@Ngone51
Copy link
Member Author

Ngone51 commented Apr 27, 2021

@attilapiros I'm not sure if I misunderstood your request. I have done the UI experiment (#32356 (comment)) and it turns out UI isn't affected. So I think I don't have to add the UI screenshot.

@attilapiros
Copy link
Contributor

@Ngone51 Oh I see. Then please update the "Does this PR introduce any user-facing change?" section to "No."

As users cannot see / should not care about test logs.

@attilapiros
Copy link
Contributor

In the title you can add [TESTS].

@Ngone51
Copy link
Member Author

Ngone51 commented Apr 27, 2021

As users cannot see / should not care about test logs.

@attilapiros It's not only able to see in the test, but also in a user application. Here, I used the test as an example to show the difference.

And probably it's my bad not to mention in advance: I changed a little bit in the test in order to show the error message (it's captured previously). So, I'm not fixing the test.

@attilapiros
Copy link
Contributor

I think I see what you mean and why I am confused: I know you are not fixing a test but as you used test logs and said the UI is not affected I thought it has only relevance for test execution. But of course this fixes the application log as well.

So let's mention "application log" in the PR description to help the others who are reading the commit message after the merge.

Copy link
Contributor

@attilapiros attilapiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tgravescs
Copy link
Contributor

changes look fine to me

@attilapiros
Copy link
Contributor

I leave it here for 2 more days to let the others to review it and if no issue comes up I'll merge it (assuming it's still passing CI and no review is in progress).

@HyukjinKwon
Copy link
Member

Will leave it to you @attilapiros then :-)

@attilapiros
Copy link
Contributor

@HyukjinKwon I am keeping my promise made here: #32180 (comment)

@Ngone51
Copy link
Member Author

Ngone51 commented Apr 29, 2021

thanks all!

@Ngone51 Ngone51 deleted the format-stage-error-message branch April 29, 2021 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants