Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10627

Task Scanner not stopable

    XMLWordPrintable

Details

    Description

      A job that is task scanning is not stoppable. Attempted from Jenkins (build executor), Project (build list) and actual build (numbered instance) with no effect

      Attachments

        Issue Links

          Activity

            moncreaff Greg Moncreaff created issue -
            drulli Ulli Hafner added a comment -

            This is not implemented yet. Seems that the build result currently is not correctly set. I need to check if this also needs something in core...

            Some implementation notes from #IRC

            (09:37:47 PM) drulli: kohsuke: Is there a flag to poll, when I want to abort my Publisher in Publisher.perform() because the user canceled a job on the UI? Seems that the Job.Result is not set to ABORTED while my publisher is running...
            (09:38:33 PM) kohsuke: It sounds like we should be setting the result
            (09:38:51 PM) kohsuke: But I recall there were some tricky regression in that area which made me change the code back and forth
            (09:39:23 PM) drulli: Ok, I see.
            (09:40:23 PM) drulli: How does a maven build job get notified that it needs to be stopped because the user canceled the job?
            (09:40:40 PM) drulli: This is currently working quite well...
            (09:41:08 PM) kohsuke: hmm, checking the code, it seems like it should be setting the status
            (09:41:13 PM) kohsuke: I guess you get null status?
            (09:41:34 PM) drulli: Actually I get the STABLE or UNSTABLE status...
            (09:42:24 PM) drulli: Is it possible, to set the status from ABORTED to UNSTABLE?
            (09:42:48 PM) kohsuke: Not after it's set to ABORTED
            (09:43:18 PM) kohsuke: But in recent version when you call Executor.interrupt you can pass in the status, so the code that's initiating abort can set it to UNSTABLE instead of ABORTED
            (09:43:31 PM) drulli: Which part of the code handles the user cancel? Maybe I can set a breakpoint there
            (09:43:52 PM) kohsuke: Executor.interrupt()
            (09:44:08 PM) drulli: Ok thanks. I will look into it!
            (09:44:10 PM) kohsuke: then catch(InterruptedException) is used to handle interruption during build
            (09:44:16 PM) kohsuke: thanks
            
            drulli Ulli Hafner added a comment - This is not implemented yet. Seems that the build result currently is not correctly set. I need to check if this also needs something in core... Some implementation notes from #IRC (09:37:47 PM) drulli: kohsuke: Is there a flag to poll, when I want to abort my Publisher in Publisher.perform() because the user canceled a job on the UI? Seems that the Job.Result is not set to ABORTED while my publisher is running... (09:38:33 PM) kohsuke: It sounds like we should be setting the result (09:38:51 PM) kohsuke: But I recall there were some tricky regression in that area which made me change the code back and forth (09:39:23 PM) drulli: Ok, I see. (09:40:23 PM) drulli: How does a maven build job get notified that it needs to be stopped because the user canceled the job? (09:40:40 PM) drulli: This is currently working quite well... (09:41:08 PM) kohsuke: hmm, checking the code, it seems like it should be setting the status (09:41:13 PM) kohsuke: I guess you get null status? (09:41:34 PM) drulli: Actually I get the STABLE or UNSTABLE status... (09:42:24 PM) drulli: Is it possible, to set the status from ABORTED to UNSTABLE? (09:42:48 PM) kohsuke: Not after it's set to ABORTED (09:43:18 PM) kohsuke: But in recent version when you call Executor.interrupt you can pass in the status, so the code that's initiating abort can set it to UNSTABLE instead of ABORTED (09:43:31 PM) drulli: Which part of the code handles the user cancel? Maybe I can set a breakpoint there (09:43:52 PM) kohsuke: Executor.interrupt() (09:44:08 PM) drulli: Ok thanks. I will look into it! (09:44:10 PM) kohsuke: then catch(InterruptedException) is used to handle interruption during build (09:44:16 PM) kohsuke: thanks
            drulli Ulli Hafner made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-9158 [ JENKINS-9158 ]

            Code changed in jenkins
            User: Ulli Hafner
            Path:
            src/main/java/hudson/plugins/analysis/core/HealthAwarePublisher.java
            src/main/java/hudson/plugins/analysis/core/HealthAwareReporter.java
            http://jenkins-ci.org/commit/analysis-core-plugin/67001d64f8e76da90c4f4eeda742e32e8117524f
            Log:
            JENKINS-10627 JENKINS-9158 Stop publisher if job is aborted.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/HealthAwarePublisher.java src/main/java/hudson/plugins/analysis/core/HealthAwareReporter.java http://jenkins-ci.org/commit/analysis-core-plugin/67001d64f8e76da90c4f4eeda742e32e8117524f Log: JENKINS-10627 JENKINS-9158 Stop publisher if job is aborted.

            Code changed in jenkins
            User: Ulli Hafner
            Path:
            src/main/java/hudson/plugins/tasks/parser/WorkspaceScanner.java
            http://jenkins-ci.org/commit/tasks-plugin/5c2a29ce6c313ad9cfc0936ecd962801fa89e0e2
            Log:
            [FIXED JENKINS-10627] Abort tasks scanning if user pressed cancel.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/tasks/parser/WorkspaceScanner.java http://jenkins-ci.org/commit/tasks-plugin/5c2a29ce6c313ad9cfc0936ecd962801fa89e0e2 Log: [FIXED JENKINS-10627] Abort tasks scanning if user pressed cancel.
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            dogfood dogfood added a comment -
            dogfood dogfood added a comment - Integrated in plugins_analysis-core #159
            dogfood dogfood added a comment -

            Integrated in plugins_tasks #123

            dogfood dogfood added a comment - Integrated in plugins_tasks #123
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 140821 ] JNJira + In-Review [ 189278 ]

            People

              drulli Ulli Hafner
              moncreaff Greg Moncreaff
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: