Workspace race condition with gerrit triggers

12 views
Skip to first unread message

Berceanu Cristian

unread,
Jun 13, 2016, 3:58:44 AM6/13/16
to Jenkins Users
I have a very simple build step set up: Pull the change from a gerrit server and then build that change. I do pull patchset so the pull doesn't download the whole repo. I also set up a workspace for the next task to compile the downloaded patchset. My question is: Can this run into a race condition? My build takes around 1 minute and if someone commits something in that 1 minute I'm afraid the other task will fire and will overwrite the workspace, since it's a shared workspace.

Björn Pedersen

unread,
Jun 13, 2016, 4:02:16 AM6/13/16
to Jenkins Users
Hi,

if it is a shared workspace, then yes, it will have a race condition. Use one of the lock-out plugins to limit the concurrency of the job to 1, then the jobs will get queued instead.

Björn

Berceanu Cristian

unread,
Jun 13, 2016, 8:34:10 AM6/13/16
to Jenkins Users
Thanks a million! I'll do that
Reply all
Reply to author
Forward
0 new messages