You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2023/06/26 01:22:36 UTC
[GitHub] [spark] dongjoon-hyun opened a new pull request, #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
dongjoon-hyun opened a new pull request, #41731:
URL: https://github.com/apache/spark/pull/41731
### What changes were proposed in this pull request?
This is a follow-up of https://github.com/apache/spark/pull/41709 to address the review comments.
### Why are the changes needed?
1. Use `JAVA_HOME` prefixed `jmap` to ensure the same version's `JVM` and JMAP.
2. Use the existing stderr instead of merging `stderr` and `stdout` via `redirectErrorStream`
3. Use `tryWithResource`.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manual review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #41731:
URL: https://github.com/apache/spark/pull/41731#discussion_r1241364434
##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -2291,15 +2291,16 @@ private[spark] object Utils extends Logging with SparkClassUtils {
def getHeapHistogram(): Array[String] = {
// From Java 9+, we can use 'ProcessHandle.current().pid()'
val pid = getProcessName().split("@").head
- val builder = new ProcessBuilder("jmap", "-histo:live", pid)
- builder.redirectErrorStream(true)
+ val jmap = System.getProperty("java.home") + "/bin/jmap"
+ val builder = new ProcessBuilder(jmap, "-histo:live", pid)
val p = builder.start()
- val r = new BufferedReader(new InputStreamReader(p.getInputStream()))
val rows = ArrayBuffer.empty[String]
- var line = ""
- while (line != null) {
- if (line.nonEmpty) rows += line
- line = r.readLine()
+ Utils.tryWithResource(new BufferedReader(new InputStreamReader(p.getInputStream()))) { r =>
Review Comment:
@mridulm . I'll make another PR to limit the number of results and to address your comment for readLine parts. In this PR, I just wrapped with `tryWithResource`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #41731:
URL: https://github.com/apache/spark/pull/41731#issuecomment-1606700586
Merged to master!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #41731:
URL: https://github.com/apache/spark/pull/41731#issuecomment-1606395895
cc @pan3793 and @mridulm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #41731:
URL: https://github.com/apache/spark/pull/41731#issuecomment-1606700004
Thank you for reviewing and fixing the issue, @pan3793 and @yaooqinn .
I didn't realized the level of severity at first glance. Sorry for that. Thank you for your help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun closed pull request #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #41731: [SPARK-44153][CORE][UI][FOLLOWUP] Use JAVA_HOME and stderr
URL: https://github.com/apache/spark/pull/41731
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org