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 acquire deadlock & timeout handling fixed #6

Closed rschuetz closed 4 years ago

rschuetz commented 4 years ago

Fix #1: Due to the limited size of the ForkJoinThreadpool used by the plugin, there is a high risk of deadlocks / low throughput if many or all threads are waiting to acquire a semaphore, and none or just a few threads are available to actually trigger the custom code or release semaphores again. Fix #2: The timeout handling for acquireSemaphore with body is broken: The body gets executed after a timeout and the (not acquired) semaphore gets released.

jswager-cisco commented 4 years ago

Will this PR be merged? I've encountered the problems described here and wondering the updated plugin will be available. Well, at least the code. :)

rschuetz commented 4 years ago

You can build the plug-in yourself from the source of this PR: https://github.com/rschuetz/concurrent-step-plugin

jswager-cisco commented 4 years ago

@rschuetz - True, I can do that. Given how useful these commands can be, I'll probably do that. This approach was much better defined than the workarounds that I saw in the Jenkins forums.