Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: metadata-plugin
-
Similar Issues:
Description
I am unable to completely delete a job. Something is happening where after a delete of the job, the job will get recreated. I believe it has to do with the SaveableOperation class as the run method is being invoked. I inserted some debugging code in this class and noticed that this class is invoked after the delete has been performed.
Steps to reproduce:
Create a new Job
Delete Job
Restart Jenkins
Job exists still but is disabled.
I have attached a junit test for verifying this as being an issue. If you look at the test unit it will perform the delete and grabs the timestamp of the file being created before and after. It will also do an assert if the directory still exists after the reload.
Looks like a race condition. Something (TBD) is calling SaveableListener as or right before the job is being deleted. A SaveableOperation task is scheduled, waits a second (thus ensuring that the job has been deleted before it proceeds!), then calls save() on the job and so recreates the config.xml that had just been removed. At least this is what I think is happening. So the fix would be to either make the save operation synchronous (if the unspecified deadlock issues are no longer a consideration); or to explicitly check for the job having been deleted by the time it runs.