Skip to main content

Pipeline fails to loop inside a NonCPS method in a master-slave setup

Comments

5 comments

  • Permanently deleted user

    If you take a look at https://jenkins.io/blog/2017/02/01/pipeline-scalability-best-practice/  it is not recommended the use of .each{} for loops this is a common problem. You need to use C-style loop, i.e. for(int i=0; i<max; i++){ }

    0
  • Niristotle Okram

    Thanks for the pointer. I have modified the pipeline.. But there seems to be another issue. The for loops works, until i use another FOR loop inside the first FOR loop (a nested FOR loop).. Is this a bug?

    0
  • Niristotle Okram

    Please ignore, i had a typo 

    0
  • Permanently deleted user

    Did you resolve it changing to FOR loops?

    0
  • Niristotle Okram

    Yes, i have to change the JSON file to use List for the the FOR loop to work. My test was in a jenkins 2.x env. But unfortunately when i put the script into a jenkins running in ver1.6; things keeps failing... 

    Looks like there is a namespace class between the 'invokeMethod' in the StreamMarkupBuilder() and something else in Jenkins. 

    I am not sure on what exactly needs to be upgraded to fix this.  

    0

Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.