Is there a way to make jobs in Jenkins mutually exclusive?

wanderso picture wanderso · Sep 13, 2011 · Viewed 9.5k times · Source

I have a few jobs in Jenkins that use Selenium to modify a database through a website's front end. If some of these jobs run at the same time, errors due to dirty reads can result. Is there a way to force certain jobs in Jenkins to be unable to run at the same time? I would prefer not to have to place or pick up a lock on the database, which could be read or modified by any number of users who are also testing.

Answer

recampbell picture recampbell · Sep 14, 2011

You want the Throttle Concurrent Builds plugin which lets you define global and per-node semaphores.

Locks and latches is being deprecated in favor of Throttle Concurrent builds.