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

Blue Ocean plug-in causes stack overflow for big pipeline jobs

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • blueocean-plugin
    • Blue Ocean 1.5 - beta 1

      Yesterday I found that I get a stack overflow exception for jobs executing lot of steps.

      The issue does not occur if blue ocean is not installed.

      Most simple solution is to run an echo step inside a loop, e.g.:

      timestamps {
          for (int i = 0; true; ++i) {
              echo i.toString()
          }    
      }
      

      Using default java vm settings this fails mostly at about loop count ~ 4600+.

      Hope there's an easy way to fix this.

      Error message is as follows:

      <snip>
      15:36:10 4605
      [Pipeline] echo
      15:36:10 4606
      [Pipeline] End of Pipeline
      java.lang.StackOverflowError
      	at org.jenkinsci.plugins.workflow.graph.FlowNode.getPersistentAction(FlowNode.java:344)
      	at org.jenkinsci.plugins.workflow.graph.FlowNode.getAction(FlowNode.java:370)
      	at io.jenkins.blueocean.events.PipelineEventListener.getParentBlock(PipelineEventListener.java:110)
      	at io.jenkins.blueocean.events.PipelineEventListener.getParentBlock(PipelineEventListener.java:120)
      	at io.jenkins.blueocean.events.PipelineEventListener.getParentBlock(PipelineEventListener.java:120)
      	at io.jenkins.blueocean.events.PipelineEventListener.getParentBlock(PipelineEventListener.java:120)
      ...
      <snip>
      

          [JENKINS-48820] Blue Ocean plug-in causes stack overflow for big pipeline jobs

          Looking at the code it should be quite easy to fix. Just need to replace the recursive call in getParentBlock() by a loop. I  would be willing to give it a try - however until now I didn't do any Jenkins plugin development.

          For use this might become blocking in the near future.

          Joerg Schwaerzler added a comment - Looking at the code it should be quite easy to fix. Just need to replace the recursive call in getParentBlock() by a loop. I  would be willing to give it a try - however until now I didn't do any Jenkins plugin development. For use this might become blocking in the near future.

          James Dumay added a comment -

          vivek small one that would be good to fix.

          James Dumay added a comment - vivek small one that would be good to fix.

          jdumay: Why is this one down-prioritized? The bug is a complete show stopper for using Blue Ocean on our team.

          Thomas Johansen added a comment - jdumay : Why is this one down-prioritized? The bug is a complete show stopper for using Blue Ocean on our team.

          Vivek Pandey added a comment -

          Vivek Pandey added a comment - thxmasj I have PR opened,  https://github.com/jenkinsci/blueocean-plugin/pull/1667/: )

            vivek Vivek Pandey
            macdrega Joerg Schwaerzler
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: