0

I have a pipeline job that calls node() exactly once, so I'm assuming I should have only one executor consumed by the job. But, I'm seeing 2 executors consumed every single time the job runs. The job is somewhat unique in that from the UI, node() is not called, the UI only calls a global pipeline step I wrote to initialize the build, which does call node() and then the load step to load the proper Jenkinsfile. This is still the only time that node() is called. What else could be eating up an extra executor, how can I figure this out?

user797963
  • 2,907
  • 9
  • 47
  • 88
  • Is this similar to your problem statement ? https://stackoverflow.com/questions/53604983/jenkins-pipeline-downstream-job-and-agent-label?noredirect=1#comment94120780_53604983 – Namrata Shilpi Dec 27 '18 at 04:37

1 Answers1

2

The first executor - the one that runs the code outside of the node block - is a flyweight executor. those executors run on master and they are not limited.

the executors that runs the code that inside the node block is a heavyweight executor. those kind are limited.

flyweight executors are just threads, running inside of the Jenkins master’s JVM. Flyweight executors are unlimited and will be created automatically when needed, unlike heavyweight executors, which are limited based on their node’s configuration.

Every Pipeline build itself runs on the master, using a flyweight Executor — an uncounted slot that is assumed to not take any significant computational power.

for further reading see https://support.cloudbees.com/hc/en-us/articles/360012808951-Pipeline-Difference-between-flyweight-and-heavyweight-Executors

Tidhar Klein Orbach
  • 2,896
  • 2
  • 30
  • 47