Details

    • 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.

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          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.

          Show
          jglick Jesse Glick added a comment - 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.
          Hide
          schristou Steven Christou added a comment -
          Show
          schristou Steven Christou added a comment - See pull request https://github.com/jenkinsci/metadata-plugin/pull/1 for fix.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: christ66
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/metadata/contributors/JobContributorsController.java
          src/test/java/com/sonyericsson/hudson/plugins/metadata/DeleteTest.java
          http://jenkins-ci.org/commit/metadata-plugin/5311c94061a02964f3eb7baea814300e1fc289ad
          Log:
          [FIXED JENKINS-20113] - Unable to delete metadata job.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: src/main/java/com/sonyericsson/hudson/plugins/metadata/contributors/JobContributorsController.java src/test/java/com/sonyericsson/hudson/plugins/metadata/DeleteTest.java http://jenkins-ci.org/commit/metadata-plugin/5311c94061a02964f3eb7baea814300e1fc289ad Log: [FIXED JENKINS-20113] - Unable to delete metadata job.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/metadata/contributors/JobContributorsController.java
          src/test/java/com/sonyericsson/hudson/plugins/metadata/DeleteTest.java
          http://jenkins-ci.org/commit/metadata-plugin/2842fd93fd1f028a93c1583c18f78516fb4ccec2
          Log:
          Merge pull request #1 from christ66/master

          [FIXED JENKINS-20113] - Unable to delete metadata job.

          Compare: https://github.com/jenkinsci/metadata-plugin/compare/856b69bc393d...2842fd93fd1f

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/java/com/sonyericsson/hudson/plugins/metadata/contributors/JobContributorsController.java src/test/java/com/sonyericsson/hudson/plugins/metadata/DeleteTest.java http://jenkins-ci.org/commit/metadata-plugin/2842fd93fd1f028a93c1583c18f78516fb4ccec2 Log: Merge pull request #1 from christ66/master [FIXED JENKINS-20113] - Unable to delete metadata job. Compare: https://github.com/jenkinsci/metadata-plugin/compare/856b69bc393d...2842fd93fd1f
          Hide
          jonathanb Jonathan Brecher added a comment -

          We're seeing the same behavior using Jenkins 1.550 (latest as of today). Is there any way to find WHAT is calling SaveableListener?

          Show
          jonathanb Jonathan Brecher added a comment - We're seeing the same behavior using Jenkins 1.550 (latest as of today). Is there any way to find WHAT is calling SaveableListener?
          Hide
          schristou Steven Christou added a comment -

          You need to upgrade the metadata-plugin as the code changes to resolve this issue are for the metadata-plugin and not core Jenkins.

          Show
          schristou Steven Christou added a comment - You need to upgrade the metadata-plugin as the code changes to resolve this issue are for the metadata-plugin and not core Jenkins.
          Hide
          jonathanb Jonathan Brecher added a comment -

          We don't have the metadata-plugin installed at all.
          I guess that means I need to open a new issue. I'll go do that...

          Show
          jonathanb Jonathan Brecher added a comment - We don't have the metadata-plugin installed at all. I guess that means I need to open a new issue. I'll go do that...
          Hide
          ioannis Ioannis Moutsatsos added a comment - - edited

          SORRY!! It seems that my attachments destined for JENKINS-26957 were attached here by mistake. Could somebody delete please! Thanks

          Show
          ioannis Ioannis Moutsatsos added a comment - - edited SORRY!! It seems that my attachments destined for JENKINS-26957 were attached here by mistake. Could somebody delete please! Thanks

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              schristou Steven Christou
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: