Skip to content

[SPARK-4913] Fix incorrect event log path#3755

Closed
viirya wants to merge 2 commits into
apache:masterfrom
viirya:fix_app_logdir
Closed

[SPARK-4913] Fix incorrect event log path#3755
viirya wants to merge 2 commits into
apache:masterfrom
viirya:fix_app_logdir

Conversation

@viirya

@viirya viirya commented Dec 21, 2014

Copy link
Copy Markdown
Member

SPARK-2261 uses a single file to log events for an app. eventLogDir in ApplicationDescription is replaced with eventLogFile. However, ApplicationDescription in SparkDeploySchedulerBackend is initialized with SparkContext's eventLogDir. It is just the log directory, not the actual log file path. Master.rebuildSparkUI can not correctly rebuild a new SparkUI for the app.

Because the ApplicationDescription is remotely registered with Master and the app's id is then generated in Master, we can not get the app id in advance before registration. So the received description needs to be modified with correct eventLogFile value.

@ash211

ash211 commented Dec 21, 2014

Copy link
Copy Markdown
Contributor

ok to test

@SparkQA

SparkQA commented Dec 21, 2014

Copy link
Copy Markdown

Test build #24687 has finished for PR 3755 at commit b5730a1.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen

Copy link
Copy Markdown
Contributor

/cc @vanzin @andrewor14 (#1222)

@viirya

viirya commented Dec 22, 2014

Copy link
Copy Markdown
Member Author

Looks like the test failed not because of this PR. Please test it again.

@vanzin

vanzin commented Dec 22, 2014

Copy link
Copy Markdown
Contributor

Hmm, guess I missed this in my testing.

Anyway, I think this is the wrong place for the fix. The right fix in my view should be in SparkDeploySchedulerBackend, where the application description is created.

@vanzin

vanzin commented Dec 22, 2014

Copy link
Copy Markdown
Contributor

Here's what I think is a better approach, feel free to use / adapt it:
https://gist.github.com/vanzin/e1910b11ce00630fe9d4

@andrewor14

Copy link
Copy Markdown
Contributor

retest this please

@vanzin I believe we separated the definition of isEventLogEnabled from that of eventLogger because of the following initialization ordering constraint. We need to pass the base log dir to the standalone master when we start the scheduler, but at that time we don't have an app ID yet so we can't specify the full path.

@vanzin

vanzin commented Dec 22, 2014

Copy link
Copy Markdown
Contributor

I see. Hmm. That sucks. :-/ A comment there would help at least, but even better would be to avoid this tight coupling altogether.

@andrewor14

Copy link
Copy Markdown
Contributor

Hey @viirya thanks for fixing this. I believe this PR works, but right fix here is to change the eventLogFile field back to an eventLogDir (because it refers to the base logging directory, not the application-specific one), and in Master#rebuildSparkUI append the application ID to the logging directory as we have done before #1222. Additionally we might want to detect the case when the application is still in progress and show a different message to warn the user that the application didn't exit cleanly.

@vanzin

vanzin commented Dec 22, 2014

Copy link
Copy Markdown
Contributor

Andrew's suggestion sounds good. Long term, I think it would be better to send this log path later (as some sort of "application stopping" message maybe?), instead of trying to send it up front like this.

@andrewor14

Copy link
Copy Markdown
Contributor

@vanzin

vanzin commented Dec 22, 2014

Copy link
Copy Markdown
Contributor

I think using EventLoggingListener.getLogPath() is safer (as in the current diff) due to the escaping it does. Just in case.

@andrewor14

Copy link
Copy Markdown
Contributor

Ah yes I forgot that exists. I have updated the branch.

@viirya

viirya commented Dec 23, 2014

Copy link
Copy Markdown
Member Author

Thanks @andrewor14 @vanzin. I made corresponding revision.

@SparkQA

SparkQA commented Dec 23, 2014

Copy link
Copy Markdown

Test build #24732 has finished for PR 3755 at commit 5e0ea35.

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

@vanzin

vanzin commented Dec 23, 2014

Copy link
Copy Markdown
Contributor

LGTM. Thanks!

@JoshRosen

Copy link
Copy Markdown
Contributor

This looks good to me, too, so I'm going to merge this into master (1.3.0) and use the commit message to close #3777 since it's a duplicate. Thanks!

@asfgit asfgit closed this in 96281cd Dec 23, 2014
@andrewor14

Copy link
Copy Markdown
Contributor

Looks great. Thanks for adding the warning about inprogress

@viirya

viirya commented Dec 24, 2014

Copy link
Copy Markdown
Member Author

Thanks for your suggestion too.

@viirya viirya deleted the fix_app_logdir branch December 27, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants