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

Building on an executor for Pipeline job is incorrect

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Minor Minor
    • metrics-plugin
    • Jenkins Enterprise

      The pipeline job report shows incorrect message "building on an executor" . Please see the attached file.

      Current status and reproducing the issue:
      -------------------------------------------------------
      Create a pipeline job with below simple script:

      echo "" + new java.util.Date()
      timeout(3) {
          node ('windows && linux') { // should no be satisfiable and will spend 3 minutes in the queue before the timeout
            abort "impossible"
          }
      }
      

      After running the pipeline job, it waits for the build to timeout. It should have spent at least 3 minutes (the initial queue time + 3 minutes waiting for a slave to match windows && linux) in the queue - rather than running.

      Look at the time reported by the job

      • 9 ms waiting in the queue;
        * 3 min 0 sec building on an executor;
      • 3 min 0 sec total from scheduled to completion.

      The report in not correct for 3 min 0 sec building on an executor; and it needs to change to 3 min 0 sec executing the pipeline because executing the pipleine != building on an executor

      Now I'm guessing someone will point out that whilst it was waiting for a node it was actually running the CPS thread so it was running - but that is really just an implementation detail and not what users expect to see.

      Now the interesting part would come with steps in parallel

      • should it sum up all time spent waiting for all nodes, and the build time is that a sum of the build time on all slaves - such that a build could have finished in 10 minutes but report 20 minutes waiting in the queue and 45 minutes building on an executor...

      I think the reporting here needs to be changed to be pipeline specific at least so it says:

      * 9 ms initially waiting in the queue; 
      * 3 min 0 sec executing the pipeline;      < executing the pipleine != building on an executor)
      * 3 min 0 sec total from scheduled to completion.
      

          [JENKINS-35630] Building on an executor for Pipeline job is incorrect

          Bahram Sanaei created issue -

          Jesse Glick added a comment -

          This text is contributed by the Metrics plugin, it seems. Probably TimeInQueueAction should be restricted to AbstractBuild; it makes little sense for other Run types.

          Jesse Glick added a comment - This text is contributed by the Metrics plugin, it seems. Probably TimeInQueueAction should be restricted to AbstractBuild ; it makes little sense for other Run types.
          Jesse Glick made changes -
          Component/s New: metrics-plugin [ 18751 ]
          Component/s Original: workflow-plugin [ 18820 ]
          Assignee Original: Jesse Glick [ jglick ]
          Labels New: workflow
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 171977 ] New: JNJira + In-Review [ 184534 ]
          Andrew Bayer made changes -
          Labels Original: workflow New: pipeline workflow
          Andrew Bayer made changes -
          Labels Original: pipeline workflow New: pipeline
          Jesse Glick made changes -
          Issue Type Original: Bug [ 1 ] New: New Feature [ 2 ]
          Christian Höltje made changes -
          Link New: This issue is related to JENKINS-42416 [ JENKINS-42416 ]
          CloudBees Inc. made changes -
          Remote Link New: This issue links to "CloudBees Internal CD-26 (Web Link)" [ 19040 ]

          Sorin Sbarnea added a comment -

          This problem is not limited to the metrics plugin. As of today, pipelines report a duration that include waiting in the queue and it seems to be no way to avoid that. This is easily testable by looking at `/api/json` or just at the "Build Duration" column.

          Sorin Sbarnea added a comment - This problem is not limited to the metrics plugin. As of today, pipelines report a duration that include waiting in the queue and it seems to be no way to avoid that. This is easily testable by looking at `/api/json` or just at the "Build Duration" column.

            Unassigned Unassigned
            bsanaei Bahram Sanaei
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: