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

Occasional StackOverflow using `downstreamParameterized` publisher

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • job-dsl-plugin
    • java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      Saw error in both: job-dsl-plugin 1.38 & 1.39-SNAPSHOT

      On our environment, we're occasionally seeing StackOverflows which seems to be traced to `downstreamParameterized`. When run on my local machine, I see the StackOverflow but am able to generate XML files. However, on a Jenkins instance, we're occasionally seeing jobs which hang/die and I think this might be the cause.

      This is the job definition I've been testing on:

      freeStyleJob('foo') {
          publishers {
              downstreamParameterized {
                  trigger('some_job') {
                      condition('UNSTABLE_OR_BETTER')
                      parameters {
                          currentBuild()
                          predefinedProps([
                                           parentJob: 'hao',
                                           artifactDir: 'blah',
                                           distribution: 'dev',
                                          ])
                      }
                  }
              }
          }
      }
      

          [JENKINS-30504] Occasional StackOverflow using `downstreamParameterized` publisher

          Ray H created issue -

          Ray H added a comment -

          I've attached a pull request which seems to fix this for me. See: https://github.com/jenkinsci/job-dsl-plugin/pull/615

          Ray H added a comment - I've attached a pull request which seems to fix this for me. See: https://github.com/jenkinsci/job-dsl-plugin/pull/615
          Ray H made changes -
          Environment Original: java version "1.8.0_60"
          Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
          Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
          New: java version "1.8.0_60"
          Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
          Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

          Saw error in both: job-dsl-plugin:1.38, job-dsl-plugin:1.39-SNAPSHOT
          Ray H made changes -
          Environment Original: java version "1.8.0_60"
          Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
          Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

          Saw error in both: job-dsl-plugin:1.38, job-dsl-plugin:1.39-SNAPSHOT
          New: java version "1.8.0_60"
          Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
          Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

          Saw error in both: job-dsl-plugin 1.38 & 1.39-SNAPSHOT

          Hm, I ran your script 1000x, but could not reproduce any StackOverflowErrors. But I could reproduce JENKINS-30271 once. StackOverflowError should not occur "occationally". Are you sure that there are no other side-effects which lead to the StackOverflowError?

          Daniel Spilker added a comment - Hm, I ran your script 1000x, but could not reproduce any StackOverflowErrors. But I could reproduce JENKINS-30271 once. StackOverflowError should not occur "occationally". Are you sure that there are no other side-effects which lead to the StackOverflowError?

          Ray H added a comment -

          I tried running this against Java 7 and I did not see the StackOverflow error. Perhaps it's something that has changed from Java 7 to Java 8. What was the environment you were testing under?

          Ray H added a comment - I tried running this against Java 7 and I did not see the StackOverflow error. Perhaps it's something that has changed from Java 7 to Java 8. What was the environment you were testing under?

          I'm running Java 7. Jenkins still uses Groovy 1.8, but Groovy 2.3 is the first version that officially supports JDK 8. See http://www.groovy-lang.org/releasenotes/groovy-2.3.html. I recommend to use JDK 7 until JENKINS-21249 got solved.

          Daniel Spilker added a comment - I'm running Java 7. Jenkins still uses Groovy 1.8, but Groovy 2.3 is the first version that officially supports JDK 8. See http://www.groovy-lang.org/releasenotes/groovy-2.3.html . I recommend to use JDK 7 until JENKINS-21249 got solved.
          Daniel Spilker made changes -
          Link New: This issue is related to JENKINS-21249 [ JENKINS-21249 ]

          Ray H added a comment -

          That sounds reasonable. We also compile our own library using `job-dsl-plugin` and we match `job-dsl-plugin`'s dependency versions to avoid running into untested behavior.

          The bug is difficult to diagnose no a Jenkins instance, because when the StackOverflowError happens, the job enters a zombie state (and you can't cancel it JENKINS-30271) and the logs do not be shipped back to the Jenkins master so no one knows if/why "StackOverflowError" happens. I've tested this fix on a snapshot build on a Ubuntu Jenkins Master/Slave running Java 1.8 and the problem no longer

          Is this patch a reasonable solution considering that Jenkins supports use of Java8?

          Ray H added a comment - That sounds reasonable. We also compile our own library using `job-dsl-plugin` and we match `job-dsl-plugin`'s dependency versions to avoid running into untested behavior. The bug is difficult to diagnose no a Jenkins instance, because when the StackOverflowError happens, the job enters a zombie state (and you can't cancel it JENKINS-30271 ) and the logs do not be shipped back to the Jenkins master so no one knows if/why "StackOverflowError" happens. I've tested this fix on a snapshot build on a Ubuntu Jenkins Master/Slave running Java 1.8 and the problem no longer Is this patch a reasonable solution considering that Jenkins supports use of Java8 ?

          I could not reproduce the problem using JDK8 either. I hesitate to merge a patch for a bug that can not be reproduced. I would rather recommend to use Java 7 and log a warning when using the Job DSL with Java 8, since the Groovy version included in Jenkins is not support on JDK8.

          Daniel Spilker added a comment - I could not reproduce the problem using JDK8 either. I hesitate to merge a patch for a bug that can not be reproduced. I would rather recommend to use Java 7 and log a warning when using the Job DSL with Java 8, since the Groovy version included in Jenkins is not support on JDK8.

            daspilker Daniel Spilker
            rymndhng Ray H
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: