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

"Ping-pong" builds store excessively large CauseAction

      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.

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

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-14818 [ JENKINS-14818 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-14816 [ JENKINS-14816 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-15747 [ JENKINS-15747 ]
          Daniel Beck made changes -
          Link New: This issue is related to JENKINS-6338 [ JENKINS-6338 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-24161 [ JENKINS-24161 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 145515 ] New: JNJira + In-Review [ 191523 ]

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

              Created:
              Updated:
              Resolved: