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-4595][Core] Fix MetricsServlet not work issue #3444

Closed
wants to merge 3 commits into from

Conversation

jerryshao
Copy link
Contributor

MetricsServlet handler should be added to the web UI after initialized by MetricsSystem, otherwise servlet handler cannot be attached.

@SparkQA
Copy link

SparkQA commented Nov 25, 2014

Test build #23822 has started for PR 3444 at commit f779fe0.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Nov 25, 2014

Test build #23822 has finished for PR 3444 at commit f779fe0.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/23822/
Test PASSed.

@JoshRosen
Copy link
Contributor

I'm finally getting around to reviewing this now. Is there a good way to test this? What's the error message / symptom thatI should look for in the buggy version of this code?

@JoshRosen
Copy link
Contributor

Ah, this was actually a pretty nasty bug since it seems to silently fail!

I'm fine merging this patch to fix this issue, but I wonder whether there are other changes that we could make to MetricsSystem in order to prevent these sorts of issues. For example, it looks like MetricsSystem has a bunch of public methods like getServletHandlers that don't indicate when they're safe to call (e.g. that they are only safe to call after the MetricsSystem has been started). Similarly, there are a bunch of public methods like registerSources, buildRegistryName, and registerSinks() that should be private.

I'd be happy to do this cleanup here, but maybe we should just merge this as-is then do the cleanup in a subsequent PR.

Actually, let's try this: I'll submit a PR to your PR which does the cleanup in MetricsSystem.scala in order to prevent these errors from occurring silently.

@JoshRosen
Copy link
Contributor

I've opened a PR against this PR in order to add defensive checks to MetricsSystem, which would have prevented the issue fixed by this PR: jerryshao#10

@jerryshao would be great if you could take a look at that and merge it into this PR branch if it looks fine to you (I've opened it against this branch).

@jerryshao
Copy link
Contributor Author

Thanks a lot Josh, I will merge into this PR and update the code :)

Add defensive checks to MetricsSystem methods; make more methods private
@SparkQA
Copy link

SparkQA commented Dec 17, 2014

Test build #24520 has started for PR 3444 at commit 434d17e.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Dec 17, 2014

Test build #24520 has finished for PR 3444 at commit 434d17e.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24520/
Test PASSed.

@JoshRosen
Copy link
Contributor

I tested this out and it looks good to me, so I'm going to merge this into master, branch-1.2, and branch-1.1. Thanks for fixing this!

asfgit pushed a commit that referenced this pull request Dec 17, 2014
`MetricsServlet` handler should be added to the web UI after initialized by `MetricsSystem`, otherwise servlet handler cannot be attached.

Author: Saisai Shao <saisai.shao@intel.com>
Author: Josh Rosen <joshrosen@databricks.com>
Author: jerryshao <saisai.shao@intel.com>

Closes #3444 from jerryshao/SPARK-4595 and squashes the following commits:

434d17e [Saisai Shao] Merge pull request #10 from JoshRosen/metrics-system-cleanup
87a2292 [Josh Rosen] Guard against misuse of MetricsSystem methods.
f779fe0 [jerryshao] Fix MetricsServlet not work issue

(cherry picked from commit cf50631)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
@asfgit asfgit closed this in cf50631 Dec 17, 2014
@JoshRosen
Copy link
Contributor

Actually, it looks like this issue doesn't affect 1.1.1, since I'm able to browse to /metrics/json after starting spark-shell. Therefore, I'm not merging this into branch-1.1 (it would have tons of merge-conflicts there, too).

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.

4 participants