Skip to content

Conversation

@gengliangwang
Copy link
Member

@gengliangwang gengliangwang commented Apr 13, 2022

This PR is to show how tricky it is to allow keywords "proxy" or "history" in reverse proxy URL. I suggest to forbid the keywords instead of support it. See PR #36176

What changes were proposed in this pull request?

When the reverse proxy URL contains "proxy" or "history", the application ID in UI is wrongly parsed.
For example, if we set spark.ui.reverseProxyURL as "/test/proxy/prefix" or "/test/history/prefix", the application ID is parsed as "prefix" and the related API calls will fail in stages/executors pages.

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors";
}
ind = words.indexOf("history");
ind = words.lastIndexOf("history");
Copy link
Member Author

Choose a reason for hiding this comment

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

If the reverse proxy URL contains "history", there is still bug.

return baseURI;
}
ind = words.indexOf("history");
ind = words.lastIndexOf("history");
Copy link
Member Author

Choose a reason for hiding this comment

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

If the reverse proxy URL contains "history", there is still bug.

dongjoon-hyun pushed a commit that referenced this pull request Apr 13, 2022
…e proxy URL

### What changes were proposed in this pull request?

When the reverse proxy URL contains "proxy" or "history", the application ID in UI is wrongly parsed.
For example, if we set spark.ui.reverseProxyURL as "/test/proxy/prefix" or "/test/history/prefix", the application ID is parsed as "prefix" and the related API calls will fail in stages/executors pages:
```
.../api/v1/applications/prefix/allexecutors
```
instead of
```
.../api/v1/applications/app-20220413142241-0000/allexecutors
```

There are more contexts in #31774
We can fix this entirely like #36174, but it is risky and complicated to do that.

### Why are the changes needed?

Avoid users setting keywords in reverse proxy URL and getting wrong UI results.

### Does this PR introduce _any_ user-facing change?

No
### How was this patch tested?

A new unit test.
Also doc preview:
<img width="1743" alt="image" src="https://user-images.githubusercontent.com/1097932/163126641-da315012-aae5-45a5-a048-340a5dd6e91e.png">

Closes #36176 from gengliangwang/forbidURLPrefix.

Authored-by: Gengliang Wang <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
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.

1 participant