-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28564][CORE] Access history application defaults to the last attempt id #25301
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
Conversation
|
ok to test |
| } | ||
| } | ||
|
|
||
| test("SPARK-28564: Access history application defaults to the last attempt id") { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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