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-20517][UI] Fix broken history UI download link #17795

Closed
wants to merge 1 commit into from

Conversation

jerryshao
Copy link
Contributor

@jerryshao jerryshao commented Apr 28, 2017

What changes were proposed in this pull request?

The download link in history server UI is concatenated with:

 <td><a href="{{uiroot}}/api/v1/applications/{{id}}/{{num}}/logs" class="btn btn-info btn-mini">Download</a></td>

Here num field represents number of attempts, this is not equal to REST APIs. In the REST API, if attempt id is not existed the URL should be api/v1/applications/<id>/logs, otherwise the URL should be api/v1/applications/<id>/<attemptId>/logs. Using <num> to represent <attemptId> will lead to the issue of "no such app".

How was this patch tested?

Manual verification.

CC @ajbozarth can you please review this change, since you add this feature before? Thanks!

Change-Id: If6d86bb229f352065eccae3d8efa3bdaf9ba755a
@SparkQA
Copy link

SparkQA commented Apr 28, 2017

Test build #76253 has finished for PR 17795 at commit 3fdba11.

  • This patch fails from timeout after a configured wait of `250m`.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jerryshao
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Apr 28, 2017

Test build #76259 has started for PR 17795 at commit 3fdba11.

@jerryshao
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Apr 28, 2017

Test build #76262 has finished for PR 17795 at commit 3fdba11.

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

@ajbozarth
Copy link
Member

This is a clean way of doing this, but my reasoning behind how I did it was from my understanding even if there's only one attempt you could still access it with an attempt id, I actually went into the code to check that it worked that way. I'm just wondering if there's a need to add this if it works as is, but if the way I had it originally is just a loophole I'm fine changing it.

@jerryshao
Copy link
Contributor Author

jerryshao commented Apr 29, 2017

@ajbozarth the key point is that several spark applications doesn't have attempt id. It's not related to one attempt or two, for example:

{
  "id" : "application_1467878474947_0048",
  "name" : "Spark shell",
  "attempts" : [ {
    "startTime" : "2016-12-30T03:22:47.300GMT",
    "endTime" : "2016-12-30T03:33:42.460GMT",
    "lastUpdated" : "2017-04-27T14:02:35.282GMT",
    "duration" : 655160,
    "sparkUser" : "spark",
    "completed" : true,
    "startTimeEpoch" : 1483068167300,
    "endTimeEpoch" : 1483068822460,
    "lastUpdatedEpoch" : 1493301755282
  } ]
}

This app doesn't have attempt id, so using api/v1/applications/<application_1467878474947_0048>/1/logs to get log will be failed in here, I think this related to my recent changes, you could verify it on latest master.

@jerryshao
Copy link
Contributor Author

This is due to my changes in #17582 , with this change, download API will verify with correct ACL, so if attemptId is not found, then withSparkUI will be failed to get correct SparkUI to do verification.

@jerryshao
Copy link
Contributor Author

@vanzin , can you please review this PR, thanks! The download link is broken after this change #17582 . Now it will check SparkUI with given appid and attemptId. Previous way of setting attemptId in JS is not correct.

@ajbozarth
Copy link
Member

Oh ok, I see why this is needed now that I see how #17582 changes how the api works, though I'm a bit worried this might not be the only thing that might've broken. You may want to look around for other cases like this where attempt ID is used for apps without one since prior to your change the api understood attempt id = 0 was the same as no attempt id.

Having said that, this LGTM

@jerryshao
Copy link
Contributor Author

@ajbozarth OK, I will verify it.

@jerryshao
Copy link
Contributor Author

@ajbozarth , I checked the UI related to attemptId, seems fine without issue. Can you please point out in which code potentially has the regression? Thanks!

@jerryshao
Copy link
Contributor Author

I assume only event log download will be effected with #17582 .

Copy link
Member

@ajbozarth ajbozarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vanzin
Copy link
Contributor

vanzin commented May 1, 2017

Merging to master / 2.2 / 2.1 / 2.0. There's a missing space in the code but I'll fix that during merge.

asfgit pushed a commit that referenced this pull request May 1, 2017
The download link in history server UI is concatenated with:

```
 <td><a href="{{uiroot}}/api/v1/applications/{{id}}/{{num}}/logs" class="btn btn-info btn-mini">Download</a></td>
```

Here `num` field represents number of attempts, this is not equal to REST APIs. In the REST API, if attempt id is not existed the URL should be `api/v1/applications/<id>/logs`, otherwise the URL should be `api/v1/applications/<id>/<attemptId>/logs`. Using `<num>` to represent `<attemptId>` will lead to the issue of "no such app".

Manual verification.

CC ajbozarth can you please review this change, since you add this feature before? Thanks!

Author: jerryshao <sshao@hortonworks.com>

Closes #17795 from jerryshao/SPARK-20517.

(cherry picked from commit ab30590)
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
asfgit pushed a commit that referenced this pull request May 1, 2017
The download link in history server UI is concatenated with:

```
 <td><a href="{{uiroot}}/api/v1/applications/{{id}}/{{num}}/logs" class="btn btn-info btn-mini">Download</a></td>
```

Here `num` field represents number of attempts, this is not equal to REST APIs. In the REST API, if attempt id is not existed the URL should be `api/v1/applications/<id>/logs`, otherwise the URL should be `api/v1/applications/<id>/<attemptId>/logs`. Using `<num>` to represent `<attemptId>` will lead to the issue of "no such app".

Manual verification.

CC ajbozarth can you please review this change, since you add this feature before? Thanks!

Author: jerryshao <sshao@hortonworks.com>

Closes #17795 from jerryshao/SPARK-20517.

(cherry picked from commit ab30590)
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
@vanzin
Copy link
Contributor

vanzin commented May 1, 2017

@jerryshao the patch didn't merge to 2.0, but your other change is there, so you should probably take a look.

@asfgit asfgit closed this in ab30590 May 1, 2017
@jerryshao
Copy link
Contributor Author

Thanks @vanzin , let me submit a patch for branch 2.0.

@jerryshao
Copy link
Contributor Author

@vanzin , since branch 2.0 doesn't have this feature in UI (https://issues.apache.org/jira/browse/SPARK-11272), so I don't think it is required to fix in branch-2.0.

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