-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-16808][Core] History Server main page does not honor APPLICATION_WEB_PROXY_BASE #15742
Conversation
Test build #68035 has finished for PR 15742 at commit
|
Test build #68036 has finished for PR 15742 at commit
|
1b153bf
to
0584339
Compare
Test build #68052 has finished for PR 15742 at commit
|
@ajbozarth @srowen - for your review if possible. |
Nice catch, from a quick look this seems good. My issue is one of consistency, in previous changes I've made I've used a setter rather that declaring a var on the scala side. I think using a default val and a setter is safer than checking for undefined. An example can be seen at the top of |
@ajbozarth updated the code. Guess, there is agreement to keep |
LGTM, putting the var and setter in |
Test build #68146 has finished for PR 15742 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments on the test, otherwise LGTM.
|
||
val proxyBaseBeforeTest = System.getProperty("spark.ui.proxyBase") | ||
val uiRoot = "/testwebproxybase" | ||
System.setProperty("spark.ui.proxyBase", uiRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to use system properties for this? Isn't it enough to set it in SparkConf
?
If you need to use system properties, you should use ResetSystemProperties
since if your test fails, it will leave the modified system properties behind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do need to use system properties as that's how this particular property seems to work. The test suite HistoryServerSuite
already uses ResetSystemProperties
, so I have fixed the tests to not try to store/reset system properties on their own.
implicitlyWait(org.scalatest.time.Span(5, org.scalatest.time.Seconds)) | ||
|
||
// once this findAll call returns, we know the ajax load of the table completed | ||
findAll (ClassNameQuery("odd")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no space before (
in method calls , also happens below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
@vanzin @ajbozarth besides your review comments, I noticed that the test case was getting blocked for 30 secs in the |
Test build #68204 has finished for PR 15742 at commit
|
retest this please |
e314450
to
4a443c5
Compare
Test build #68211 has finished for PR 15742 at commit
|
Test build #68212 has finished for PR 15742 at commit
|
@@ -143,6 +143,12 @@ class HistoryServer( | |||
appCache.stop() | |||
} | |||
|
|||
// For testing - override stop timeout used by jetty | |||
private[history] def setStopTimeout(timeout: Long): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that adding a function just to speed up tests by 30sec is unnecessary additional code in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was 30 secs additional for just the one test i added. if more such tests are added the time would add up - so i felt the option to bypass the wait was useful to have. assuming more of the UI could transition to ajax etc I could move this utility function up into the base WebUI
class so it's available more generally for future UI tests - not just history server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say if we're going to add a test util function like this that we might as well make it more available to tests, I still don't like it much, but we seem to moving in the direction where it may be useful. @vanzin what do you think of this addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a little fishy, because other tests run Jetty and don't seem to suffer from this problem (or at least no one has complained).
Maybe, if you explicitly close the selenium driver in the test, this will go away without the need for this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks to be due to the ProxyServlet handler, the way it handles requests. I am able to get around the problem by explicitly stopping the servlet handler before the test ends. No need to alter Jetty stop timeout with this change. Updated the pull request.
retest this please |
Test build #68238 has finished for PR 15742 at commit
|
Test build #68318 has finished for PR 15742 at commit
|
.map(_.get) | ||
.filter(_.startsWith(url)).toList | ||
|
||
contextHandler.stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to do this in a finally
block? And do you also need to call server.stop()
?
EDIT: nevermind the second part, the after
block already does that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, moved it to a finally
block. This should make both good and bad testcase runs consistent in their cleanup.
LGTM |
LGTM pending tests. |
Test build #68354 has finished for PR 15742 at commit
|
retest this please |
Test build #68366 has finished for PR 15742 at commit
|
Merging to master / 2.1. |
…ON_WEB_PROXY_BASE ## What changes were proposed in this pull request? Application links generated on the history server UI no longer (regression from 1.6) contain the configured spark.ui.proxyBase in the links. To address this, made the uiRoot available globally to all javascripts for Web UI. Updated the mustache template (historypage-template.html) to include the uiroot for rendering links to the applications. The existing test was not sufficient to verify the scenario where ajax call is used to populate the application listing template, so added a new selenium test case to cover this scenario. ## How was this patch tested? Existing tests and a new unit test. No visual changes to the UI. Author: Vinayak <vijoshi5@in.ibm.com> Closes #15742 from vijoshi/SPARK-16808_master. (cherry picked from commit 06a13ec) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
@vanzin since this a regression bux in 2.0, any particular reason it is merged only to 2.1 . I believe this should be in 2.0.2/3 as well |
It doesn't merge cleanly into branch-2.0. You can file a separate PR if you want it fixed there. |
ok. will look into that |
@vanzin @mariobriggs Opened #15855 for merging to branch-2.0 |
…ON_WEB_PROXY_BASE ## What changes were proposed in this pull request? Backport SPARK-16808 (#15742) to branch-2.0. Application links generated on the history server UI no longer (regression from 1.6) contain the configured spark.ui.proxyBase in the links. To address this, made the uiRoot available globally to all javascripts for Web UI. Updated the mustache template (historypage-template.html) to include the uiroot for rendering links to the applications. The existing test was not sufficient to verify the scenario where ajax call is used to populate the application listing template, so added a new selenium test case to cover this scenario. ## How was this patch tested? Existing tests and a new unit test. No visual changes to the UI. Author: Vinayak <vijoshi5@in.ibm.com> Closes #15855 from vijoshi/SPARK-16808_branch-2.0.
…ON_WEB_PROXY_BASE ## What changes were proposed in this pull request? Application links generated on the history server UI no longer (regression from 1.6) contain the configured spark.ui.proxyBase in the links. To address this, made the uiRoot available globally to all javascripts for Web UI. Updated the mustache template (historypage-template.html) to include the uiroot for rendering links to the applications. The existing test was not sufficient to verify the scenario where ajax call is used to populate the application listing template, so added a new selenium test case to cover this scenario. ## How was this patch tested? Existing tests and a new unit test. No visual changes to the UI. Author: Vinayak <vijoshi5@in.ibm.com> Closes apache#15742 from vijoshi/SPARK-16808_master.
What changes were proposed in this pull request?
Application links generated on the history server UI no longer (regression from 1.6) contain the configured spark.ui.proxyBase in the links. To address this, made the uiRoot available globally to all javascripts for Web UI. Updated the mustache template (historypage-template.html) to include the uiroot for rendering links to the applications.
The existing test was not sufficient to verify the scenario where ajax call is used to populate the application listing template, so added a new selenium test case to cover this scenario.
How was this patch tested?
Existing tests and a new unit test.
No visual changes to the UI.