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

"Ping-pong" builds store excessively large CauseAction

    Details

    • Similar Issues:

      Description

      Create two jobs, a and b, each of which does nothing but trigger the other. (Useless by itself, but a similar idiom can be used to alternate indefinitely between two actions, such as checking for changes in some part of the environment and reacting to those changes.)

      Let this run for a few dozen iterations. The build.xml file for each build can soon run into multiple megabytes. For example, on just the fourth cycle, a/builds/4/build.xml has this lengthy "cause" section:

      <hudson.model.CauseAction>
        <causes>
          <hudson.model.Cause_-UpstreamCause>
            <upstreamProject>b</upstreamProject>
            <upstreamUrl>job/b/</upstreamUrl>
            <upstreamBuild>3</upstreamBuild>
            <upstreamCauses>
              <hudson.model.Cause_-UpstreamCause>
                <upstreamProject>a</upstreamProject>
                <upstreamUrl>job/a/</upstreamUrl>
                <upstreamBuild>3</upstreamBuild>
                <upstreamCauses>
                  <hudson.model.Cause_-UpstreamCause>
                    <upstreamProject>b</upstreamProject>
                    <upstreamUrl>job/b/</upstreamUrl>
                    <upstreamBuild>2</upstreamBuild>
                    <upstreamCauses>
                      <hudson.model.Cause_-UpstreamCause>
                        <upstreamProject>a</upstreamProject>
                        <upstreamUrl>job/a/</upstreamUrl>
                        <upstreamBuild>2</upstreamBuild>
                        <upstreamCauses>
                          <hudson.model.Cause_-UpstreamCause>
                            <upstreamProject>b</upstreamProject>
                            <upstreamUrl>job/b/</upstreamUrl>
                            <upstreamBuild>1</upstreamBuild>
                            <upstreamCauses>
                              <hudson.model.Cause_-UpstreamCause>
                                <upstreamProject>a</upstreamProject>
                                <upstreamUrl>job/a/</upstreamUrl>
                                <upstreamBuild>1</upstreamBuild>
                                <upstreamCauses>
                                  <hudson.model.Cause_-UserIdCause/>
                                </upstreamCauses>
                              </hudson.model.Cause_-UpstreamCause>
                            </upstreamCauses>
                          </hudson.model.Cause_-UpstreamCause>
                        </upstreamCauses>
                      </hudson.model.Cause_-UpstreamCause>
                    </upstreamCauses>
                  </hudson.model.Cause_-UpstreamCause>
                </upstreamCauses>
              </hudson.model.Cause_-UpstreamCause>
            </upstreamCauses>
          </hudson.model.Cause_-UpstreamCause>
        </causes>
      </hudson.model.CauseAction>
      

      Excessive disk usage consumption is not the only problem; Jenkins may even refuse to start, since loading one of these files can produce a stack overflow:

      hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:180) 
      hudson.util.XStream2$PassthruConverter.unmarshal(XStream2.java:323) 
      hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:293) 
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82) 
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63) 
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76) 
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60) 
      com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71) 
      hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:85) 
      com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61) 
      hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:76) 
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82) 
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63) 
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76) 
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60) 
      hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:290) 
      hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:233) 
      hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:180)
      

      While recording transitive causes may be useful in general, there must be some sanity cutoff point.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-14818 [ JENKINS-14818 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-14816 [ JENKINS-14816 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            jglick Jesse Glick added a comment -
            Show
            jglick Jesse Glick added a comment - Filed https://github.com/jenkinsci/jenkins/pull/541 for review.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            test/src/test/java/hudson/model/CauseTest.java
            http://jenkins-ci.org/commit/jenkins/b0278767831d751b93ad77dc2c5c92b6d140e865
            Log:
            JENKINS-14814 Reproduced.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/java/hudson/model/CauseTest.java http://jenkins-ci.org/commit/jenkins/b0278767831d751b93ad77dc2c5c92b6d140e865 Log: JENKINS-14814 Reproduced.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/src/main/java/hudson/model/Cause.java
            http://jenkins-ci.org/commit/jenkins/bfa648152f266540536e76f7b3ebcb1598ad5f6f
            Log:
            [FIXED JENKINS-14814] Truncate deeply nested upstream causes.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/model/Cause.java http://jenkins-ci.org/commit/jenkins/bfa648152f266540536e76f7b3ebcb1598ad5f6f Log: [FIXED JENKINS-14814] Truncate deeply nested upstream causes.
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nicolas De loof
            Path:
            core/src/main/java/hudson/model/Cause.java
            test/src/test/java/hudson/model/CauseTest.java
            http://jenkins-ci.org/commit/jenkins/a56f00040b9fb08537131586533fb162131c8d2a
            Log:
            Merge pull request #541 from jglick/wicked_deep_cause_14814

            JENKINS-14814 "Ping-pong" builds store excessively large CauseAction

            Compare: https://github.com/jenkinsci/jenkins/compare/aaecf7915d60...a56f00040b9f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De loof Path: core/src/main/java/hudson/model/Cause.java test/src/test/java/hudson/model/CauseTest.java http://jenkins-ci.org/commit/jenkins/a56f00040b9fb08537131586533fb162131c8d2a Log: Merge pull request #541 from jglick/wicked_deep_cause_14814 JENKINS-14814 "Ping-pong" builds store excessively large CauseAction Compare: https://github.com/jenkinsci/jenkins/compare/aaecf7915d60...a56f00040b9f
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            http://jenkins-ci.org/commit/jenkins/2aa272a0fae0390eb2da679ab7c9e0d402b1f53b
            Log:
            JENKINS-14814 Noting.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html http://jenkins-ci.org/commit/jenkins/2aa272a0fae0390eb2da679ab7c9e0d402b1f53b Log: JENKINS-14814 Noting.
            Hide
            jglick Jesse Glick added a comment -

            Workaround:

            perl -i.bak -n -e 'print unless m{<hudson\.model\.CauseAction>}..m{</hudson\.model\.CauseAction>}' jobs/*/builds/*-*/build.xml
            
            Show
            jglick Jesse Glick added a comment - Workaround: perl -i.bak -n -e 'print unless m{<hudson\.model\.CauseAction>}..m{</hudson\.model\.CauseAction>}' jobs/*/builds/*-*/build.xml
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #1856
            JENKINS-14814 Reproduced. (Revision b0278767831d751b93ad77dc2c5c92b6d140e865)
            [FIXED JENKINS-14814] Truncate deeply nested upstream causes. (Revision bfa648152f266540536e76f7b3ebcb1598ad5f6f)
            JENKINS-14814 Noting. (Revision 2aa272a0fae0390eb2da679ab7c9e0d402b1f53b)

            Result = UNSTABLE
            Jesse Glick : b0278767831d751b93ad77dc2c5c92b6d140e865
            Files :

            • test/src/test/java/hudson/model/CauseTest.java

            Jesse Glick : bfa648152f266540536e76f7b3ebcb1598ad5f6f
            Files :

            • core/src/main/java/hudson/model/Cause.java

            Jesse Glick : 2aa272a0fae0390eb2da679ab7c9e0d402b1f53b
            Files :

            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1856 JENKINS-14814 Reproduced. (Revision b0278767831d751b93ad77dc2c5c92b6d140e865) [FIXED JENKINS-14814] Truncate deeply nested upstream causes. (Revision bfa648152f266540536e76f7b3ebcb1598ad5f6f) JENKINS-14814 Noting. (Revision 2aa272a0fae0390eb2da679ab7c9e0d402b1f53b) Result = UNSTABLE Jesse Glick : b0278767831d751b93ad77dc2c5c92b6d140e865 Files : test/src/test/java/hudson/model/CauseTest.java Jesse Glick : bfa648152f266540536e76f7b3ebcb1598ad5f6f Files : core/src/main/java/hudson/model/Cause.java Jesse Glick : 2aa272a0fae0390eb2da679ab7c9e0d402b1f53b Files : changelog.html
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-15747 [ JENKINS-15747 ]
            Hide
            zxkane Meng Xin Zhu added a comment -

            Do you know which build starts to have this fix? Because I still see similar issue happened in LTS 1.480.2.

            Show
            zxkane Meng Xin Zhu added a comment - Do you know which build starts to have this fix? Because I still see similar issue happened in LTS 1.480.2.
            Hide
            jglick Jesse Glick added a comment -

            Should be in 1.479, but you might be hitting JENKINS-15747.

            Show
            jglick Jesse Glick added a comment - Should be in 1.479, but you might be hitting JENKINS-15747 .
            danielbeck Daniel Beck made changes -
            Link This issue is related to JENKINS-6338 [ JENKINS-6338 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-24161 [ JENKINS-24161 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 145515 ] JNJira + In-Review [ 191523 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: