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

Building on an executor for Pipeline job is incorrect

    Details

    • Similar Issues:

      Description

      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.
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick 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.

            Show
            jglick 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.
            Hide
            ssbarnea 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.

            Show
            ssbarnea 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.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: