Github user markhamstra commented on a diff in the pull request:
https://github.com/apache/spark/pull/15441#discussion_r82924909
--- Diff: core/src/main/scala/org/apache/spark/ui/jobs/JobsTab.scala ---
@@ -35,4 +37,18 @@ private[ui] class JobsTab(parent: SparkUI) extends
SparkUITab(parent, "jobs") {
attachPage(new AllJobsPage(this))
attachPage(new JobPage(this))
+
+ def handleKillRequest(request: HttpServletRequest): Unit = {
+ if (killEnabled &&
(parent.securityManager.checkModifyPermissions(request.getRemoteUser))) {
+ val killFlag =
Option(request.getParameter("terminate")).getOrElse("false").toBoolean
+ val jobId = Option(request.getParameter("id")).getOrElse("-1").toInt
+ if (jobId >= 0 && killFlag &&
jobProgresslistener.activeJobs.contains(jobId)) {
+ sc.get.cancelJob(jobId)
+ }
--- End diff --
Similarly, there is no need for `sc.get`. In fact, that's a bug if
`parent.sc` really should be an `Option` and thus could be `None`.
```scala
sc.foreach(_.cancelJob(id))
```
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]