Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15441#discussion_r84573559
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/jobs/JobsTab.scala ---
    @@ -35,4 +37,20 @@ 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")).map(_.toInt)
    +      jobId.foreach { id =>
    +        if (killFlag && jobProgresslistener.activeJobs.contains(id)) {
    +          sc.foreach(_.cancelJob(id))
    +          // Do a quick pause here to give Spark time to kill the job so 
it shows up as
    +          // killed after the refresh. Note that this will block the 
serving thread so the
    +          // time should be limited in duration.
    +          Thread.sleep(100)
    --- End diff --
    
    Hm, in both this and the kill-stage endpoint I wonder why we have a 
'terminate' flag at all. What would it mean to call this with terminate=false? 
it seems like this can be checked once, if at all, at the start of the method. 
Or just removed, if I'm not missing 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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to