Skip to content

[SPARK-45187][CORE] Fix WorkerPage to use the same pattern for logPage urls#42959

Closed
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:SPARK-45187
Closed

[SPARK-45187][CORE] Fix WorkerPage to use the same pattern for logPage urls#42959
dongjoon-hyun wants to merge 1 commit intoapache:masterfrom
dongjoon-hyun:SPARK-45187

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Sep 17, 2023

What changes were proposed in this pull request?

This PR aims to use the same pattern for logPage urls of WorkerPage to make it work consistently when spark.ui.reverseProxy=true.

Why are the changes needed?

Since Apache Spark 3.2.0 (SPARK-34635, #31753), Apache Spark adds trailing slashes to reduce redirections for logPage.

      s"$workerUrlRef/logPage?driverId=$driverId&logType=stdout")
      s"$workerUrlRef/logPage/?driverId=$driverId&logType=stdout")
...
<a href={s"$workerUrlRef/logPage?appId=${executor
<a href={s"$workerUrlRef/logPage/?appId=${executor

This PR aims to fix a leftover in WorkerPage to make it work consistently in case of the reverse proxy situation via spark.ui.reverseProxy. Currently, in some proxy environments, appId link is working but driverId link is broken due to the redirections. This inconsistent behavior makes the users confused.

-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stderr"}>stderr</a>

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Manual tests because it requires a reverse proxy.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun
Copy link
Member Author

cc @gengliangwang and @viirya

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-45187][CORE] Fix WorkerPage to use the same pattern for logPage query parameters [SPARK-45187][CORE] Fix WorkerPage to use the same pattern for logPage urls Sep 17, 2023
Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@dongjoon-hyun
Copy link
Member Author

Thank you so much, @viirya !

dongjoon-hyun added a commit that referenced this pull request Sep 17, 2023
…Page` urls

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

This PR aims to use the same pattern for `logPage` urls of `WorkerPage` to make it work consistently when `spark.ui.reverseProxy=true`.

### Why are the changes needed?

Since Apache Spark 3.2.0 (SPARK-34635, #31753), Apache Spark adds trailing slashes to reduce redirections for `logPage`.

```scala
      s"$workerUrlRef/logPage?driverId=$driverId&logType=stdout")
      s"$workerUrlRef/logPage/?driverId=$driverId&logType=stdout")
...
<a href={s"$workerUrlRef/logPage?appId=${executor
<a href={s"$workerUrlRef/logPage/?appId=${executor
```

This PR aims to fix a leftover in `WorkerPage` to make it work consistently in case of the reverse proxy situation via `spark.ui.reverseProxy`. Currently,  in some proxy environments, `appId` link is working but `driverId` link is broken due to the redirections. This inconsistent behavior makes the users confused.

```
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
```

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

No.

### How was this patch tested?

Manual tests because it requires a reverse proxy.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42959 from dongjoon-hyun/SPARK-45187.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit f8f2735)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
dongjoon-hyun added a commit that referenced this pull request Sep 17, 2023
…Page` urls

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

This PR aims to use the same pattern for `logPage` urls of `WorkerPage` to make it work consistently when `spark.ui.reverseProxy=true`.

### Why are the changes needed?

Since Apache Spark 3.2.0 (SPARK-34635, #31753), Apache Spark adds trailing slashes to reduce redirections for `logPage`.

```scala
      s"$workerUrlRef/logPage?driverId=$driverId&logType=stdout")
      s"$workerUrlRef/logPage/?driverId=$driverId&logType=stdout")
...
<a href={s"$workerUrlRef/logPage?appId=${executor
<a href={s"$workerUrlRef/logPage/?appId=${executor
```

This PR aims to fix a leftover in `WorkerPage` to make it work consistently in case of the reverse proxy situation via `spark.ui.reverseProxy`. Currently,  in some proxy environments, `appId` link is working but `driverId` link is broken due to the redirections. This inconsistent behavior makes the users confused.

```
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
```

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

No.

### How was this patch tested?

Manual tests because it requires a reverse proxy.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42959 from dongjoon-hyun/SPARK-45187.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit f8f2735)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit 84a053e)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
dongjoon-hyun added a commit that referenced this pull request Sep 17, 2023
…Page` urls

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

This PR aims to use the same pattern for `logPage` urls of `WorkerPage` to make it work consistently when `spark.ui.reverseProxy=true`.

### Why are the changes needed?

Since Apache Spark 3.2.0 (SPARK-34635, #31753), Apache Spark adds trailing slashes to reduce redirections for `logPage`.

```scala
      s"$workerUrlRef/logPage?driverId=$driverId&logType=stdout")
      s"$workerUrlRef/logPage/?driverId=$driverId&logType=stdout")
...
<a href={s"$workerUrlRef/logPage?appId=${executor
<a href={s"$workerUrlRef/logPage/?appId=${executor
```

This PR aims to fix a leftover in `WorkerPage` to make it work consistently in case of the reverse proxy situation via `spark.ui.reverseProxy`. Currently,  in some proxy environments, `appId` link is working but `driverId` link is broken due to the redirections. This inconsistent behavior makes the users confused.

```
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
```

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

No.

### How was this patch tested?

Manual tests because it requires a reverse proxy.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42959 from dongjoon-hyun/SPARK-45187.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit f8f2735)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit 84a053e)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit b4eb947)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
@dongjoon-hyun
Copy link
Member Author

Merged to master/3.5/3.4/3.3.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-45187 branch September 17, 2023 17:36
viirya pushed a commit to viirya/spark-1 that referenced this pull request Oct 19, 2023
…Page` urls

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

This PR aims to use the same pattern for `logPage` urls of `WorkerPage` to make it work consistently when `spark.ui.reverseProxy=true`.

### Why are the changes needed?

Since Apache Spark 3.2.0 (SPARK-34635, apache#31753), Apache Spark adds trailing slashes to reduce redirections for `logPage`.

```scala
      s"$workerUrlRef/logPage?driverId=$driverId&logType=stdout")
      s"$workerUrlRef/logPage/?driverId=$driverId&logType=stdout")
...
<a href={s"$workerUrlRef/logPage?appId=${executor
<a href={s"$workerUrlRef/logPage/?appId=${executor
```

This PR aims to fix a leftover in `WorkerPage` to make it work consistently in case of the reverse proxy situation via `spark.ui.reverseProxy`. Currently,  in some proxy environments, `appId` link is working but `driverId` link is broken due to the redirections. This inconsistent behavior makes the users confused.

```
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
-        <a href={s"$workerUrlRef/logPage?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stdout"}>stdout</a>
+        <a href={s"$workerUrlRef/logPage/?driverId=${driver.driverId}&logType=stderr"}>stderr</a>
```

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

No.

### How was this patch tested?

Manual tests because it requires a reverse proxy.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#42959 from dongjoon-hyun/SPARK-45187.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit f8f2735)
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
(cherry picked from commit 84a053e)
Signed-off-by: Dongjoon Hyun <dhyun@apple.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.

2 participants