You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "mridulm (via GitHub)" <gi...@apache.org> on 2023/09/26 16:21:55 UTC

[GitHub] [spark] mridulm commented on a diff in pull request #43107: [SPARK-45322][CORE] Use ProcessHandle to get pid directly

mridulm commented on code in PR #43107:
URL: https://github.com/apache/spark/pull/43107#discussion_r1337478470


##########
core/src/main/scala/org/apache/spark/util/Utils.scala:
##########
@@ -2149,8 +2149,7 @@ private[spark] object Utils
 
   /** Return a heap dump. Used to capture dumps for the web UI */
   def getHeapHistogram(): Array[String] = {
-    // From Java 9+, we can use 'ProcessHandle.current().pid()'
-    val pid = getProcessName().split("@").head
+    val pid = String.valueOf(ProcessHandle.current().pid())

Review Comment:
   DISCUSS: the new path can result in an Exception being thrown as per documentation.
   It is not clear if this can happen for the platforms we support - do we know more about this @dongjoon-hyun ?



-- 
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