Github user attilapiros commented on a diff in the pull request:
https://github.com/apache/spark/pull/20474#discussion_r165407125
--- Diff:
core/src/main/scala/org/apache/spark/status/api/v1/OneApplicationResource.scala
---
@@ -51,6 +52,21 @@ private[v1] class AbstractApplicationResource extends
BaseAppResource {
@Path("executors")
def executorList(): Seq[ExecutorSummary] =
withUI(_.store.executorList(true))
+ @GET
+ @Path("executors/{executorId}/threads")
+ def threadDump(@PathParam("executorId") executorId: String):
+ Option[Array[ThreadStackTrace]] = withUI { ui =>
+ val safeExecutorId =
+ Option(UIUtils.stripXSS(executorId)).map { executorId =>
+ UIUtils.decodeURLParameter(executorId)
+ }.getOrElse {
+ throw new IllegalArgumentException(s"Missing executorId parameter")
+ }
+ ui.sc.flatMap { sc =>
+ sc.getExecutorThreadDump(safeExecutorId)
--- End diff --
Thanks. Yes, currently it gives back null. You are right an error message
definitely is needed here. Moreover I can check for totally bogus executorId
(neither "driver" nor parsable to integer), finally I can access
ExecutorSummary to decide whether the executor is active. The history server
check is also easy.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]