jenkinsci / concurrent-step-plugin

Jenkins plugin to use utils in Java concurrent package.
https://plugins.jenkins.io/concurrent-step/
MIT License
21 stars 8 forks source link

acquireSemaphore permit seems to be limited #15

Open xtroncode opened 3 years ago

xtroncode commented 3 years ago

Hi, I am using the plugin in the following way

def semaphore = createSemaphore permit:7

def s = [:]

for(int i = 0; i < 100; i ++) 
{
 def id="${i}"
 s.put("semaphore" + id, { -> acquireSemaphore (semaphore){
                                  sleep time:100,unit:"MILLISECONDS"
                                  echo "semaphore" + id + " body"
                              }
                         })
}

parallel s

this seems to run only 3 processes concurrently not matter what the value of permit is. Is the number of concurrent steps limited by the cpu count or something else irrespective of the permit parameter ?

Thanks.

tobiasweibel commented 1 year ago

I can confirm the same with CloudBees Jenkins Enterprise 2.332.3.4-rolling