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

Stack overflow in WorkflowRun.reload after run ID migration

    Details

    • Similar Issues:

      Description

      Observed with post-1.597 cores, after run ID migration.

      hudson.model.Run.<init>(Run.java:320)
      org.jenkinsci.plugins.workflow.job.WorkflowRun.<init>(WorkflowRun.java:133)
      sun.reflect.GeneratedConstructorAccessor65.newInstance(Unknown Source)
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      java.lang.reflect.Constructor.newInstance(Constructor.java:408)
      jenkins.model.lazy.LazyBuildMixIn.loadBuild(LazyBuildMixIn.java:158)
      jenkins.model.lazy.LazyBuildMixIn$1.create(LazyBuildMixIn.java:135)
      hudson.model.RunMap.retrieve(RunMap.java:222)
      hudson.model.RunMap.retrieve(RunMap.java:57)
      jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:465)
      jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:448)
      jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:356)
      hudson.model.RunMap.getById(RunMap.java:203)
      org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:559)
      org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.getRootDir(WorkflowRun.java:588)
      org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.getStorageDir(CpsFlowExecution.java:315)
      org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.createStorage(CpsFlowExecution.java:308)
      org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.access$800(CpsFlowExecution.java:188)
      org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$ConverterImpl.unmarshal(CpsFlowExecution.java:817)
      hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:362)
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:349)
      hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:289)
      hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:228)
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
      com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
      com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
      com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
      hudson.util.XStream2.unmarshal(XStream2.java:113)
      com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
      hudson.XmlFile.unmarshal(XmlFile.java:163)
      org.jenkinsci.plugins.workflow.job.WorkflowRun.reload(WorkflowRun.java:360)
      hudson.model.Run.<init>(Run.java:320)
      

      While it is awkward that CpsFlowExecution deserialization in turn forces the WorkflowRun candidate to be returned from Owner.run, this is normally harmless. The problem here seems to be that after RunIdMigrator has run, the WorkflowRun.id is read (via key) by reload, yet it is still null at that point because unmarshal has yet to be called, so LOADING_RUNS is inaccurate.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Summary Stack overflow in WorkflowRun.reload Stack overflow in WorkflowRun.reload after run ID migration
            Description Observed with newer cores, after run ID migration.

            {code:none}
            hudson.model.Run.<init>(Run.java:320)
            org.jenkinsci.plugins.workflow.job.WorkflowRun.<init>(WorkflowRun.java:133)
            sun.reflect.GeneratedConstructorAccessor65.newInstance(Unknown Source)
            sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            java.lang.reflect.Constructor.newInstance(Constructor.java:408)
            jenkins.model.lazy.LazyBuildMixIn.loadBuild(LazyBuildMixIn.java:158)
            jenkins.model.lazy.LazyBuildMixIn$1.create(LazyBuildMixIn.java:135)
            hudson.model.RunMap.retrieve(RunMap.java:222)
            hudson.model.RunMap.retrieve(RunMap.java:57)
            jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:465)
            jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:448)
            jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:356)
            hudson.model.RunMap.getById(RunMap.java:203)
            org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:559)
            org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.getRootDir(WorkflowRun.java:588)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.getStorageDir(CpsFlowExecution.java:315)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.createStorage(CpsFlowExecution.java:308)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.access$800(CpsFlowExecution.java:188)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$ConverterImpl.unmarshal(CpsFlowExecution.java:817)
            hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:362)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
            com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
            hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:349)
            hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:289)
            hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:228)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
            com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
            com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
            com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
            com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
            hudson.util.XStream2.unmarshal(XStream2.java:113)
            com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
            hudson.XmlFile.unmarshal(XmlFile.java:163)
            org.jenkinsci.plugins.workflow.job.WorkflowRun.reload(WorkflowRun.java:360)
            hudson.model.Run.<init>(Run.java:320)
            {code}
            Observed with post-1.597 cores, after run ID migration.

            {code:none}
            hudson.model.Run.<init>(Run.java:320)
            org.jenkinsci.plugins.workflow.job.WorkflowRun.<init>(WorkflowRun.java:133)
            sun.reflect.GeneratedConstructorAccessor65.newInstance(Unknown Source)
            sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            java.lang.reflect.Constructor.newInstance(Constructor.java:408)
            jenkins.model.lazy.LazyBuildMixIn.loadBuild(LazyBuildMixIn.java:158)
            jenkins.model.lazy.LazyBuildMixIn$1.create(LazyBuildMixIn.java:135)
            hudson.model.RunMap.retrieve(RunMap.java:222)
            hudson.model.RunMap.retrieve(RunMap.java:57)
            jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:465)
            jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:448)
            jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:356)
            hudson.model.RunMap.getById(RunMap.java:203)
            org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:559)
            org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.getRootDir(WorkflowRun.java:588)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.getStorageDir(CpsFlowExecution.java:315)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.createStorage(CpsFlowExecution.java:308)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.access$800(CpsFlowExecution.java:188)
            org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$ConverterImpl.unmarshal(CpsFlowExecution.java:817)
            hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:362)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
            com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
            hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:349)
            hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:289)
            hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:228)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
            com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
            com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
            com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
            com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
            com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
            hudson.util.XStream2.unmarshal(XStream2.java:113)
            com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
            hudson.XmlFile.unmarshal(XmlFile.java:163)
            org.jenkinsci.plugins.workflow.job.WorkflowRun.reload(WorkflowRun.java:360)
            hudson.model.Run.<init>(Run.java:320)
            {code}

            While it is awkward that {{CpsFlowExecution}} deserialization in turn forces the {{WorkflowRun}} candidate to be returned from {{Owner.run}}, this is normally harmless. The problem here seems to be that after {{RunIdMigrator}} has run, the {{WorkflowRun.id}} is read (via {{key}}) by {{reload}}, yet it is still null at that point because {{unmarshal}} has yet to be called, so {{LOADING_RUNS}} is inaccurate.
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-24380 [ JENKINS-24380 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 97 (Web Link)" [ 12171 ]
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26761 [ JENKINS-26761 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-27704 [ JENKINS-27704 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 159 (Web Link)" [ 13003 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 161740 ] JNJira + In-Review [ 196854 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: