You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by JoshRosen <gi...@git.apache.org> on 2014/10/26 04:09:59 UTC

[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

GitHub user JoshRosen opened a pull request:

    https://github.com/apache/spark/pull/2944

    [SPARK-611] [WIP] Display executor thread dumps in web UI

    This patch allows executor thread dumps to be viewed in the Spark web UI.
    
    Thread dumps obtained from Thread.getAllStackTraces() are piggybacked
    on the periodic executor -> driver heartbeats.  JobProgressListener
    stores these heartbeats for display in the UI.
    
    One current limitation is that the driver thread dumps are not viewable
    except when running in local mode.
    
    This is [WIP] pending a few issues which I'll comment on inline.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/JoshRosen/spark jstack-in-web-ui

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/2944.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2944
    
----
commit 0f198acb65c43d6a98c674f049bd96ea7816fdab
Author: Josh Rosen <jo...@databricks.com>
Date:   2014-10-26T02:57:28Z

    [SPARK-611] Display executor thread dumps in web UI
    
    This patch allows executor thread dumps to be viewed in the Spark web UI.
    
    Thread dumps obtained from Thread.getAllStackTraces() are piggybacked
    on the periodic executor -> driver heartbeats.  JobProgressListener
    stores these heartbeats for display in the UI.
    
    One current limitation is that the driver thread dumps are not viewable
    except when running in local mode.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61309382
  
      [Test build #22616 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22616/consoleFull) for   PR 2944 at commit [`19707b0`](https://github.com/apache/spark/commit/19707b04d58a32d8951c08e7cae753c381dfaa57).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ExecutorActor(executorId: String) extends Actor with ActorLogReceive with Logging `
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60878899
  
      [Test build #22433 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22433/consoleFull) for   PR 2944 at commit [`bc1e675`](https://github.com/apache/spark/commit/bc1e675f0204e6f111cf7ec49cdb318150ecef54).
     * This patch **fails to build**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60877916
  
      [Test build #22430 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22430/consoleFull) for   PR 2944 at commit [`f4ac1c1`](https://github.com/apache/spark/commit/f4ac1c1099019cc43525508545452e22eb677a70).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61021043
  
      [Test build #22482 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22482/consoleFull) for   PR 2944 at commit [`3dfc2d4`](https://github.com/apache/spark/commit/3dfc2d46ec018a140d86d5f0931d4fc3936f0963).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ExecutorActor(executorId: String) extends Actor with ActorLogReceive with Logging `
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60859702
  
    What if we had a 1000-node cluster, though, and kept the default heartbeat interval of 10 seconds?  In that case, we'd be sending a huge flood of data to the driver, 99.9% of which end up being overwritten / discarded.  From a performance / stability perspective, it's probably better to fetch this on-demand.
    
    I'm going to see how long it takes to throw together a quick "actor in the executor" prototype.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60846448
  
    Upon closer inspection, there's not a general driver -> executor RPC path that I can use to send arbitrary Akka messages to executors.  To keep this PR simple and narrow in scope, I'm just going to add a separate RPC.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61564237
  
      [Test build #22831 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22831/consoleFull) for   PR 2944 at commit [`3c21a5d`](https://github.com/apache/spark/commit/3c21a5dcd7be7ad648d9e17b6643a72404cf34a4).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60837888
  
    The other idea I had was that we could just open a port on the executor and have a web ui on it. This could also display the executor's stderr (Which is very painful to get to right now) and have links to get thread stack trace, memory histo etc. However this might be a larger change


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19759466
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/exec/ThreadDumpPage.scala ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ui.exec
    +
    +import javax.servlet.http.HttpServletRequest
    +
    +import scala.util.Try
    +import scala.xml.{Text, Node}
    +
    +import org.apache.spark.ui.{UIUtils, WebUIPage}
    +
    +class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") {
    +
    +  private val sc = parent.sc
    +
    +  def render(request: HttpServletRequest): Seq[Node] = {
    +    val executorId = Option(request.getParameter("executorId")).getOrElse {
    +      return Text(s"Missing executorId parameter")
    +    }
    +    val time = System.currentTimeMillis()
    +    val maybeThreadDump = Try(sc.get.getExecutorThreadDump(executorId))
    --- End diff --
    
    Do we want to log some warning if this fails?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60878689
  
      [Test build #22433 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22433/consoleFull) for   PR 2944 at commit [`bc1e675`](https://github.com/apache/spark/commit/bc1e675f0204e6f111cf7ec49cdb318150ecef54).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60680949
  
      [Test build #22305 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22305/consoleFull) for   PR 2944 at commit [`cc3e6b3`](https://github.com/apache/spark/commit/cc3e6b3b61b1c4561bf2d0726da4ca1b2f753f16).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SparkListenerExecutorThreadDump(`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60856220
  
      [Test build #22402 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22402/consoleFull) for   PR 2944 at commit [`4c87d7f`](https://github.com/apache/spark/commit/4c87d7ff9fe381bb0bf71fddf7fd426b65ef277f).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61394867
  
      [Test build #22744 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22744/consoleFull) for   PR 2944 at commit [`f719266`](https://github.com/apache/spark/commit/f71926608cf61de791d3db4b9bed2762e72fad33).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60818745
  
    @JoshRosen This is super awesome !


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60878901
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22433/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19764605
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/exec/ExecutorsTab.scala ---
    @@ -27,8 +27,13 @@ import org.apache.spark.ui.{SparkUI, SparkUITab}
     
     private[ui] class ExecutorsTab(parent: SparkUI) extends SparkUITab(parent, "executors") {
       val listener = parent.executorsListener
    +  val threadDumpEnabled = parent.conf.getBoolean("spark.ui.threadDumpsEnabled", true)
    --- End diff --
    
    I originally added this when we had automatic executor -> driver periodic thread dumps.  I guess we don't need it anymore, unless you think it would be useful to have as a sort of "access control" feature.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19378809
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/local/LocalBackend.scala ---
    @@ -47,7 +47,7 @@ private[spark] class LocalActor(
     
       private var freeCores = totalCores
     
    -  private val localExecutorId = "localhost"
    +  private val localExecutorId = "<driver>"
    --- End diff --
    
    While working on this, I noticed that the links to view the driver thread dumps weren't working.  In `local` mode, it looks like we weren't using the same name for the local executor id in this Executor and in the driver's SparkEnv, so I fixed that here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60668699
  
      [Test build #22305 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22305/consoleFull) for   PR 2944 at commit [`cc3e6b3`](https://github.com/apache/spark/commit/cc3e6b3b61b1c4561bf2d0726da4ca1b2f753f16).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60852214
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22383/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61342193
  
      [Test build #22644 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22644/consoleFull) for   PR 2944 at commit [`19707b0`](https://github.com/apache/spark/commit/19707b04d58a32d8951c08e7cae753c381dfaa57).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ExecutorActor(executorId: String) extends Actor with ActorLogReceive with Logging `
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60834858
  
    It looks like executorIds are assigned by the cluster manager, so in principle they could be arbitrary strings but in practice they seem to not contain special characters that would need special escaping (such as spaces).  The application master log viewer (LogPage.scala) doesn't perform any URL-encoding or escaping of executorIds, so I'm not sure that we need to do it here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61538427
  
    Hey I just left a few relatively minor comments but the overall approach looks good. It's great to see that we're not doing this through the block manager interface. In the long run we may want to move more of the existing stuff into `ExecutorActor` so we don't do everything through the block manager actors.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61342198
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22644/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60505272
  
    Executor IDs are strings, so I should probably check whether they'll need to be url-encoded; I guess this depends on which components create these strings.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60505573
  
      [Test build #22228 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22228/consoleFull) for   PR 2944 at commit [`8c10216`](https://github.com/apache/spark/commit/8c1021636efcc34af925ec6c43f4757b8034ce56).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61336346
  
      [Test build #22644 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22644/consoleFull) for   PR 2944 at commit [`19707b0`](https://github.com/apache/spark/commit/19707b04d58a32d8951c08e7cae753c381dfaa57).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60680961
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22305/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60505076
  
      [Test build #22228 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22228/consoleFull) for   PR 2944 at commit [`8c10216`](https://github.com/apache/spark/commit/8c1021636efcc34af925ec6c43f4757b8034ce56).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60505192
  
    One subtle issue that I've run into is that the driver always runs a block manager but only runs an Executor in local mode.  So, the "executors" tab in the web UI is slightly misleading when running in a cluster mode, since the driver doesn't run a regular executor.  It would be nice to have driver / application thread dumps in this UI, too, so I wonder if there's a clean way to fix this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60818581
  
    This is even easier to read than the raw jstack output


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60856334
  
    Alright, I've updated this to send the dumps as part of a separate fire-and-forget RPC and removed the new code from the heartbeat code paths (which should make things cleaner).
    
    One final thing that I may experiment with is compression of the stack traces.  There's bound to be a lot of redundancy in these stacktraces, so they should be highly compressible.
    
    I'm also going to add an option to disable sending stacktraces so that we have an escape-hatch in case this turns out to be a problem (or if a user would rather not expose stacktraces in the UI for some reason).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61021051
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22482/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19757342
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
    @@ -361,6 +361,18 @@ class SparkContext(config: SparkConf) extends SparkStatusAPI with Logging {
         override protected def childValue(parent: Properties): Properties = new Properties(parent)
       }
     
    +  /** Called by the web UI to obtain executor thread dumps */
    +  private[spark] def getExecutorThreadDump(executorId: String): Array[ThreadStackTrace] = {
    +    if (executorId == SparkContext.DRIVER_IDENTIFIER) {
    +      Utils.getThreadDump()
    +    } else {
    +      val (host, port) = env.blockManager.master.getActorSystemHostPortForExecutor(executorId).get
    --- End diff --
    
    This is kind of scary; we might get `None.get` exceptions if the executor dies while we try to get its stack trace. We should probably add a safeguard for this case and log a warning or something.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/2944


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60858892
  
    Hmm okay - I agree that we don't really have a request - reply route from the web ui (maybe this is also worth investigating if / when we have a executor web ui).
    
    Doing a periodic thread stack trace back to the driver sounds good for now. Also you can just have a flag to enable or disable this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60862610
  
      [Test build #22402 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22402/consoleFull) for   PR 2944 at commit [`4c87d7f`](https://github.com/apache/spark/commit/4c87d7ff9fe381bb0bf71fddf7fd426b65ef277f).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SparkListenerExecutorThreadDump(`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60664728
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22301/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19757211
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala ---
    @@ -131,7 +131,8 @@ private[spark] object CoarseGrainedExecutorBackend extends Logging {
           // Create a new ActorSystem using driver's Spark properties to run the backend.
           val driverConf = new SparkConf().setAll(props)
           val (actorSystem, boundPort) = AkkaUtils.createActorSystem(
    -        "sparkExecutor", hostname, port, driverConf, new SecurityManager(driverConf))
    +        SparkEnv.executorActorSystemName,
    --- End diff --
    
    Nice, we had this variable but we just never used it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60846384
  
    Yes - I think having a separate RPC sounds good for now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61573903
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60852209
  
      [Test build #22383 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22383/consoleFull) for   PR 2944 at commit [`2b8bdf3`](https://github.com/apache/spark/commit/2b8bdf384f83e89529a1458fa2f7f3adbe460885).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SparkListenerExecutorThreadDump(`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shaneknapp <gi...@git.apache.org>.
Github user shaneknapp commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60668583
  
    jenkins, test this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61564034
  
    Alright, I took another pass on this:
    
    - Rename ThreadDumpPage -> ExecutorThreadDumpPage
    - Make page private[ui]
    - Make TriggerThreadDump into a case object
    - Rename fields in ThreadStackTrace
    - Use ThreadMxBean to obtain thread dumps instead of Thread.getAllStackTraces()
    - Remove documentation of spark.ui.threadDumpsEnabled configuration, but leave
      the option as an internal configuration
    - Guard against exceptions in SparkContext.getExecutorThreadDump()
    - Disable thread dump page and button in history server.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60837003
  
    Do you know how large the threadDump is typically ? I'm concerned this might make the heartbeat too large


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19521449
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/exec/ThreadDumpPage.scala ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ui.exec
    +
    +import javax.servlet.http.HttpServletRequest
    +
    +import scala.util.Try
    +import scala.xml.{Text, Node}
    +
    +import org.apache.spark.ui.{UIUtils, WebUIPage}
    +
    +class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") {
    +
    +  private val sc = parent.sc
    +
    +  def render(request: HttpServletRequest): Seq[Node] = {
    +    val executorId = Option(request.getParameter("executorId")).getOrElse {
    +      return Text(s"Missing executorId parameter")
    +    }
    +    val time = System.currentTimeMillis()
    +    val maybeThreadDump = Try(sc.get.getExecutorThreadDump(executorId))
    --- End diff --
    
    This is a blocking call.  From a high-performance HTTP server standpoint, this is probably a bad idea; it might improve throughput to handle this in some sort of future / continuation so that we don't starve the request handling threadpool while waiting on a remote RPC.  On the other hand, I don't think that we should over-engineer things right now; we can always move towards a fancier request handling strategy if we discover that we need it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60878081
  
      [Test build #22430 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22430/consoleFull) for   PR 2944 at commit [`f4ac1c1`](https://github.com/apache/spark/commit/f4ac1c1099019cc43525508545452e22eb677a70).
     * This patch **fails to build**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60857677
  
    Another subtlety: when the web UI receives a request for a thread-dump, it would need to issue a RPC to the executor to fetch that request.  Ideally, we wouldn't block the UI server thread in order to prevent a slow driver -> executor round trip from leading to a huge buildup of waiting threads and causing starvation / dropped requests.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19759259
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/exec/ExecutorsTab.scala ---
    @@ -27,8 +27,13 @@ import org.apache.spark.ui.{SparkUI, SparkUITab}
     
     private[ui] class ExecutorsTab(parent: SparkUI) extends SparkUITab(parent, "executors") {
       val listener = parent.executorsListener
    +  val threadDumpEnabled = parent.conf.getBoolean("spark.ui.threadDumpsEnabled", true)
    --- End diff --
    
    When do we not want to enable this? Is this just a safeguard in case this breaks things?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60505576
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22228/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61300157
  
      [Test build #22616 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22616/consoleFull) for   PR 2944 at commit [`19707b0`](https://github.com/apache/spark/commit/19707b04d58a32d8951c08e7cae753c381dfaa57).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61573077
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22831/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60862614
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22402/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61309391
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22616/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61573067
  
      [Test build #22831 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22831/consoleFull) for   PR 2944 at commit [`3c21a5d`](https://github.com/apache/spark/commit/3c21a5dcd7be7ad648d9e17b6643a72404cf34a4).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ExecutorActor(executorId: String) extends Actor with ActorLogReceive with Logging `
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60842701
  
    @shivaram That's a good point RE: the size of the thread dumps.  I can now imagine problems where a thread-leak in an executor causes the heartbeat to become huge and leads to a job failure when the heartbeat exceeds the Akka frame size.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61584018
  
    Ok I'm merging this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shivaram <gi...@git.apache.org>.
Github user shivaram commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60857056
  
    That sounds good -- Actually could we make this a request-reply pattern ? i.e we only fetch the stack traces if somebody clicks on the link ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19759363
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/exec/ThreadDumpPage.scala ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ui.exec
    +
    +import javax.servlet.http.HttpServletRequest
    +
    +import scala.util.Try
    +import scala.xml.{Text, Node}
    +
    +import org.apache.spark.ui.{UIUtils, WebUIPage}
    +
    +class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") {
    --- End diff --
    
    Also, maybe we should call this `ExecutorThreadDumpPage` to be more explicit


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19764813
  
    --- Diff: core/src/main/scala/org/apache/spark/util/ThreadStackTrace.scala ---
    @@ -0,0 +1,23 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.util
    +
    +/**
    + * Used for shipping per-thread stacktraces from the executors to driver.
    + */
    +private[spark] case class ThreadStackTrace(id: Long, name: String, state: String, trace: String)
    --- End diff --
    
    It's actually a thread ID, so I'll rename it to `threadId`.  `state` is the state of the thread (RUNNING, WAITING, etc.); I'll also document this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61012331
  
      [Test build #22482 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22482/consoleFull) for   PR 2944 at commit [`3dfc2d4`](https://github.com/apache/spark/commit/3dfc2d46ec018a140d86d5f0931d4fc3936f0963).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19521370
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterActor.scala ---
    @@ -412,6 +415,17 @@ class BlockManagerMasterActor(val isLocal: Boolean, conf: SparkConf, listenerBus
           Seq.empty
         }
       }
    +
    +  private def getActorSystemHostPortForExecutor(executorId: String): Option[(String, Int)] = {
    --- End diff --
    
    This verbosely-named method is the big "hack" for enabling driver -> executor RPC.  Basically, I needed to have a way to address the remote `ExecutorActor` from the driver.  Here, we rely on the fact that every executor registers a BlockManager actor with the BlockManagerMasterActor and that there is only one actor system per executor / driver.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60857353
  
    I've thought about that, but it looks like we don't actually create addressable actors on the executors, so there's no path for the driver to send an RPC to the executor (other than as a reply to a RPC received from an executor).
    
    I _do_ have an ActorSystem ref, though, so I suppose that I could create a new actor for this that lives inside of the Executor.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60650825
  
      [Test build #22301 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22301/consoleFull) for   PR 2944 at commit [`cc3e6b3`](https://github.com/apache/spark/commit/cc3e6b3b61b1c4561bf2d0726da4ca1b2f753f16).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60818509
  
    Wow, awesome!!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61335973
  
    retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60845020
  
    I like the idea of running a separate UI server on the executor, but this seems like a much more involved change that will take a lot more design review.  For example, we'd have to consider how those web UIs will be secured, which ports they will bind to, etc.
    
    As a shorter-term fix, how about de-coupling the thread dumps from the heartbeats so that huge thread dumps won't cause heartbeats to be lost?  If we do this, I might be able to add a driver -> executor RPC path to allow heartbeats to be triggered from the web UI.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60877993
  
    I've rewritten this patch so that thread dumps are triggered on-demand using a new driver -> executor RPC channel.  There are a few hacks involved in setting this up, mostly to work around some limitations of our current executor registration mechanisms without resorting to heavy refactoring.  Please take a look and let me know what you think.
    
    I'm going to leave a couple of comments on the diff to help explain the hackier parts of these changes.
    
    Also, we still might want to enable compression of the stacktrace RPCs, but I'll leave that to a separate PR (this would be a good starter JIRA task, BTW).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19759629
  
    --- Diff: core/src/main/scala/org/apache/spark/util/ThreadStackTrace.scala ---
    @@ -0,0 +1,23 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.util
    +
    +/**
    + * Used for shipping per-thread stacktraces from the executors to driver.
    + */
    +private[spark] case class ThreadStackTrace(id: Long, name: String, state: String, trace: String)
    --- End diff --
    
    It's unclear what `id` is. I would either rename this `executorId` or rename the class itself `ExecutorThreadStackTrace`. Also what is `state`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19759344
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/exec/ThreadDumpPage.scala ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ui.exec
    +
    +import javax.servlet.http.HttpServletRequest
    +
    +import scala.util.Try
    +import scala.xml.{Text, Node}
    +
    +import org.apache.spark.ui.{UIUtils, WebUIPage}
    +
    +class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") {
    --- End diff --
    
    This needs to be `private[spark]` or even `private[ui]`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61396223
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22744/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60843263
  
      [Test build #22383 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22383/consoleFull) for   PR 2944 at commit [`2b8bdf3`](https://github.com/apache/spark/commit/2b8bdf384f83e89529a1458fa2f7f3adbe460885).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19757366
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/ExecutorActor.scala ---
    @@ -0,0 +1,41 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.executor
    +
    +import akka.actor.Actor
    +import org.apache.spark.Logging
    +
    +import org.apache.spark.util.{Utils, ActorLogReceive}
    +
    +/**
    + * Driver -> Executor message to trigger a thread dump.
    + */
    +private[spark] case class TriggerThreadDump()
    --- End diff --
    
    Why not case object?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61396221
  
      [Test build #22744 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/22744/consoleFull) for   PR 2944 at commit [`f719266`](https://github.com/apache/spark/commit/f71926608cf61de791d3db4b9bed2762e72fad33).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class ExecutorActor(executorId: String) extends Actor with ActorLogReceive with Logging `
      * `  case class GetActorSystemHostPortForExecutor(executorId: String) extends ToBlockManagerMaster`
      * `class ThreadDumpPage(parent: ExecutorsTab) extends WebUIPage("threadDump") `
      * `class DecimalType(DataType):`
      * `case class UnscaledValue(child: Expression) extends UnaryExpression `
      * `case class MakeDecimal(child: Expression, precision: Int, scale: Int) extends UnaryExpression `
      * `case class MutableLiteral(var value: Any, dataType: DataType, nullable: Boolean = true)`
      * `case class PrecisionInfo(precision: Int, scale: Int)`
      * `case class DecimalType(precisionInfo: Option[PrecisionInfo]) extends FractionalType `
      * `final class Decimal extends Ordered[Decimal] with Serializable `
      * `  trait DecimalIsConflicted extends Numeric[Decimal] `



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by shaneknapp <gi...@git.apache.org>.
Github user shaneknapp commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60664970
  
    jenkins, test this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-61394856
  
    I've pushed a new commit to fix the merge conflict here.  Could someone review this latest revision?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] Display executor thread dumps in w...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2944#discussion_r19769160
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1609,6 +1609,15 @@ private[spark] object Utils extends Logging {
         s"$className: $desc\n$st"
       }
     
    +  /** Return a thread dump of all threads' stacktraces.  Used to capture dumps for the web UI */
    +  def getThreadDump(): Array[ThreadStackTrace] = {
    +    Thread.getAllStackTraces.toArray.sortBy(_._1.getId).map {
    +      case (thread, stackElements) =>
    +        val stackTrace = stackElements.map(_.toString).mkString("\n")
    +        ThreadStackTrace(thread.getId, thread.getName, thread.getState.toString, stackTrace)
    --- End diff --
    
    Just spotted a consistency issue here: `thread.getState` is grabbed at a different time than the stack elements.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-611] [WIP] Display executor thread dump...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2944#issuecomment-60878083
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22430/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org