Skip to content

Conversation

@cxzl25
Copy link
Contributor

@cxzl25 cxzl25 commented Jul 30, 2019

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

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-28564][SHS] Access history application defaults to the last attempt id [SPARK-28564][CORE] Access history application defaults to the last attempt id Jul 30, 2019
@dongjoon-hyun
Copy link
Member

ok to test

}
}

test("SPARK-28564: Access history application defaults to the last attempt id") {
Copy link
Member

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.

Copy link
Contributor Author

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

@SparkQA
Copy link

SparkQA commented Jul 30, 2019

Test build #108412 has finished for PR 25301 at commit 8d7e805.

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

Copy link
Contributor

@vanzin vanzin left a 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")
Copy link
Contributor

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("/")) {
Copy link
Contributor

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(...)

@SparkQA
Copy link

SparkQA commented Jul 30, 2019

Test build #108410 has finished for PR 25301 at commit e9372e4.

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

@SparkQA
Copy link

SparkQA commented Jul 31, 2019

Test build #108442 has finished for PR 25301 at commit ae42c61.

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

@vanzin
Copy link
Contributor

vanzin commented Jul 31, 2019

Merging to master, will try 2.4.

@vanzin vanzin closed this in 70ef906 Jul 31, 2019
vanzin pushed a commit that referenced this pull request Jul 31, 2019
…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>
rluta pushed a commit to rluta/spark that referenced this pull request Sep 17, 2019
…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>
kai-chi pushed a commit to kai-chi/spark that referenced this pull request Sep 26, 2019
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants