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

Semaphore is shared between Jobs when using a Pipeline library. #13

Open Xyaren opened 4 years ago

Xyaren commented 4 years ago

As the title says: Using a semaphore in a pipeline libary that is imported in multiple projects is shared between jobs. Is this intended ? How can I prevent this ?

gpolek commented 4 years ago

Do we have any update in this topic? We are heavily using shared pipelines and this causes deadlocks in our jobs.

Spacetown commented 4 years ago

I've the same Problem. With this restriction isn't usable in a multibranch pipeline. I think this is because the pipeline is always executed on the master.

Xyaren commented 4 years ago

Which is fine if the job name and build number is part of the "key".

Spacetown commented 4 years ago

@Xyaren But there is no key option.

Spacetown commented 4 years ago

I've searched arround and didn't a semaphore implementation with named semaphores. I think the only solution for this is to implement a own semaphore with synchronized functions doing spinlock with a sleep or using a BlockingQueue.

touting15 commented 4 years ago

I've been impacted by the same thing. I never had any issues using the plugin until I began using it in another job's pipeline code.

touting15 commented 4 years ago

Have you found any jenkins/groovy friendly solutions @Spacetown ?

Spacetown commented 4 years ago

@touting15 No.

jondhoor commented 1 year ago

Has there been any solution or workaround yet? We would really like to use this feature in a multibranch pipeline.

Spacetown commented 1 year ago

Has there been any solution or workaround yet? We would really like to use this feature in a multibranch pipeline.

Not from my side.