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

Job.getEstimatedDurationCandidates should not force loading of builds

      View/index.jelly View/sidepanel.jelly ExecutorStepExecution/PlaceholderTask/PlaceholderExecutable/executorCell.jelly has been observed to trigger build loading:

      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:430)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:527)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:502)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:568)
      at hudson.model.RunMap.retrieve(RunMap.java:224)
      at hudson.model.RunMap.retrieve(RunMap.java:56)
      at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:500)
      at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:482)
      at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:380)
      - locked <...> (a hudson.model.RunMap)
      at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:345)
      at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoadRunMap.java:275)
      at jenkins.model.lazy.LazyBuildMixIn.getLastBuild(LazyBuildMixIn.java:245)
      at org.jenkinsci.plugins.workflow.job.WorkflowJob.getLastBuild(WorkflowJob.java:244)
      at org.jenkinsci.plugins.workflow.job.WorkflowJob.getLastBuild(WorkflowJob.java:106)
      at hudson.model.Job.getEstimatedDurationCandidates(Job.java:1007)
      at hudson.model.Job.getEstimatedDuration(Job.java:1033)
      at hudson.model.Run.getEstimatedDuration(Run.java:2331)
      at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.getEstimatedDuration(ExecutorStepExecution.java:419)
      at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask$PlaceholderExecutable.getEstimatedDuration(ExecutorStepExecution.java:614)
      at hudson.model.queue.Executables.getEstimatedDurationFor(Executables.java:78)
      

      This is unreasonable—the UI should not be forcing build loading. There was a recent optimization in JENKINS-48350, and JENKINS-45585 is partly to blame, but really getEstimatedDurationCandidates ought to be calling AbstractLazyLoadRunMap.getLoadedBuilds or otherwise declining to load builds which were not already loaded anyway.

          [JENKINS-50030] Job.getEstimatedDurationCandidates should not force loading of builds

          Daniel Beck added a comment -

          This is unreasonable—the UI should not be forcing build loading.

          Disagree. IIRC, estimated duration looks at the five newest builds, which isn't unreasonable. There'd just be useless unknown build duration estimates if this were implemented.

          Daniel Beck added a comment - This is unreasonable—the UI should not be forcing build loading. Disagree. IIRC, estimated duration looks at the five newest builds, which isn't unreasonable. There'd just be useless unknown build duration estimates if this were implemented.

          Jesse Glick added a comment -

          Jesse Glick added a comment - Fixed in https://github.com/jenkinsci/jenkins/pull/7998 .

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: