[SPARK-28564][CORE] Access history application defaults to the last attempt id#25301
[SPARK-28564][CORE] Access history application defaults to the last attempt id#25301cxzl25 wants to merge 3 commits intoapache:masterfrom
Conversation
|
ok to test |
| } | ||
| } | ||
|
|
||
| test("SPARK-28564: Access history application defaults to the last attempt id") { |
There was a problem hiding this comment.
Hi, @cxzl25 .
Since you created a JIRA issue with Improvement type, we don't use JIRA ID in the test case name.
That's because we don't add JIRA ID prefix for all new features.
There was a problem hiding this comment.
ok, I remember now. thanks for your reminder
|
Test build #108412 has finished for PR 25301 at commit
|
vanzin
left a comment
There was a problem hiding this comment.
Some suggestions otherwise looks ok.
| assert(code === 302, s"Unexpected status code $code for $url") | ||
| attemptId match { | ||
| case None => | ||
| assert(location.stripSuffix("/") === lastAttemptUrl.toString, s"Unexpected url") |
There was a problem hiding this comment.
The "unexpected url" message is unnecessary (also below).
| // Also, make sure that the redirect url contains the query string present in the request. | ||
| val requestURI = req.getRequestURI + Option(req.getQueryString).map("?" + _).getOrElse("") | ||
| val attemptPart = if (shouldAppendAttemptId) { | ||
| if (!req.getRequestURI.endsWith("/")) { |
There was a problem hiding this comment.
Simpler:
val redirect = if (shouldAppendAttemptId) {
req.getRequestURI().stripSuffix("/") + "/" + attemptId.get
} else {
req.getRequestURI()
}
val query = Option(req.getQueryString).map("?" + _).getOrElse("")
res.sendRedirect(...)
|
Test build #108410 has finished for PR 25301 at commit
|
|
Test build #108442 has finished for PR 25301 at commit
|
|
Merging to master, will try 2.4. |
…ttempt id ## What changes were proposed in this pull request? When we set ```spark.history.ui.maxApplications``` to a small value, we can't get some apps from the page search. If the url is spliced (http://localhost:18080/history/local-xxx), it can be accessed if the app has no attempt. But in the case of multiple attempted apps, such a url cannot be accessed, and the page displays Not Found. ## How was this patch tested? Add UT Closes #25301 from cxzl25/hs_app_last_attempt_id. Authored-by: sychen <sychen@ctrip.com> Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com> (cherry picked from commit 70ef906) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
…ttempt id ## What changes were proposed in this pull request? When we set ```spark.history.ui.maxApplications``` to a small value, we can't get some apps from the page search. If the url is spliced (http://localhost:18080/history/local-xxx), it can be accessed if the app has no attempt. But in the case of multiple attempted apps, such a url cannot be accessed, and the page displays Not Found. ## How was this patch tested? Add UT Closes apache#25301 from cxzl25/hs_app_last_attempt_id. Authored-by: sychen <sychen@ctrip.com> Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com> (cherry picked from commit 70ef906) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
…ttempt id ## What changes were proposed in this pull request? When we set ```spark.history.ui.maxApplications``` to a small value, we can't get some apps from the page search. If the url is spliced (http://localhost:18080/history/local-xxx), it can be accessed if the app has no attempt. But in the case of multiple attempted apps, such a url cannot be accessed, and the page displays Not Found. ## How was this patch tested? Add UT Closes apache#25301 from cxzl25/hs_app_last_attempt_id. Authored-by: sychen <sychen@ctrip.com> Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com> (cherry picked from commit 70ef906) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
What changes were proposed in this pull request?
When we set
spark.history.ui.maxApplicationsto a small value, we can't get some apps from the page search.If the url is spliced (http://localhost:18080/history/local-xxx), it can be accessed if the app has no attempt.
But in the case of multiple attempted apps, such a url cannot be accessed, and the page displays Not Found.
How was this patch tested?
Add UT