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

Each postBuildStep block takes 1 second to evaluate, DSL seed jobs went up from 10mins to 1 hour

XMLWordPrintable

      We were using post build script old version, and just upgraded to the new version which looks great. Thanks!

      We're using postBuildScript with Job DSL. Each "postBuildStep" in the postBuildScripts takes 1 full second just to evaluate (note: not the generation, just the evaluation of this single block takes 1s). We are generating around 1500 jobs, each with 3 post build steps, and the Seed jobs are now taking more than an hour to run.

      Sample DSL and output below.

      println "    ${ZonedDateTime.now()} postbuildscript start"
      postBuildScript {
        markBuildUnstable(true)
        buildSteps {
          postBuildStep {
            results(Arrays.asList("SUCCESS", "UNSTABLE", "FAILURE", "NOT_BUILT", "ABORTED"))
            role("SLAVE")
            buildSteps {
              scriptBuildStep {
                buildStepId("[redacted]")
                scriptBuildStepArgs {
                  defineArgs(false)
                  tokenized(false)
                }
              }
            }
          }
          postBuildStep {
            results(Arrays.asList("SUCCESS"))
            role("SLAVE")
            buildSteps {
              shell {
                command("[redacted]")
              }
            }
          }
          postBuildStep {
            results(Arrays.asList("FAILURE"))
            role("SLAVE")
            buildSteps {
              shell {
                command("[redacted]")
              }
            }
          }
        }
      }
      println "    ${ZonedDateTime.now()} postbuildscript end"
      

      Output:

      2018-01-25T23:13:38.246+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:41.355+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:41.597+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:44.180+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:44.561+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:48.403+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:48.592+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:51.224+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:51.405+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:53.573+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:53.688+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:55.221+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:55.333+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:56.841+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:56.982+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:13:59.251+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:13:59.410+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:14:01.732+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:14:01.886+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:14:04.231+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:14:04.375+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:14:06.656+01:00[Europe/Berlin] postbuildscript end
      2018-01-25T23:14:06.797+01:00[Europe/Berlin] postbuildscript start
      2018-01-25T23:14:09.167+01:00[Europe/Berlin] postbuildscript end
      

      During this time, Jenkins master is found to use constant 25% of CPU as well. We tested this after putting Jenkins on maintenance mode, so only this job takes 25% of CPU on master.

      We have confirmed after multiple attempts that each postBuildStep takes 1 second to evaluate. If we have two postBuildSteps, the logs are printed 2s apart. 1 step and logs take 1s, etc.

      Any ideas what can be going wrong?

            dheid Daniel Heid
            fm4zyqnfbbfpim Subhas Dandapani
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: