Steps to Reproduce:
1) Create a Freestyle Job. Add a "sleep 120" command to the job.
2) Execute the Freestyle Job twice. One instance will execute, the other instance will be in the queue.
3) While first instance is executing issue "Reload From Disk Command" either via Browser, CLI, or Manage Jenkins Menu
4) Wait till both instances complete execution.
5) Execute the Freestyle Job once more
At this point you will receive a Dead Thread, with the following:
java.lang.IllegalStateException: /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2
Three instances of the job have been tried to run. The first instance completed successfully, however the second instance, the one that was pending in the queue during the Reload Configuration From Disk, succeeded, however the nextBuildNumber will not be incremented to 3, but will remain 2.
When the third instance the one that fails immediately with the above exception, it is trying to use 2 instead of because the nextBuildNumber says 2 is the correct value.
Also if at the time of the "Reload Configuration from Disk" is executed, there are X number of copies of the same job in the Queue, pending execution, all of these will properly execute afterward, however, that job will fail X number times after those have completed.
|Resolution||Duplicate [ 3 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Workflow||JNJira [ 169788 ]||JNJira + In-Review [ 198682 ]|