Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17439

Perforce Quick Clean Does Not Remove All Build Files; Fails to Halt the Build

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • p4-plugin
    • None
    • Windows 2008 Server

      I hit a case where the Perforce "quick clean" option does not remove all of my class files.

      This leaves a class file in the /classes output directory, and when rebuilt, blocks the anonymous (MyClass$Anon.class) files from being generated, breaking the build.

      I do not see any error messages that indicate the root cause of this issue.

      This issues took me hours to track down and verify. If quick-clean had aborted the build when it fails, this would have saved a lot of headache.

      Here is failing directory before the clean:

      d---- 4/2/2013 3:52 PM firstperson
      d---- 4/2/2013 3:52 PM orbit
      a-- 4/2/2013 3:52 PM 16553 BasicView.class
      a-- 4/2/2013 3:52 PM 4859 BasicViewPropertyLimits.class
      a-- 4/2/2013 3:52 PM 2793 ViewElevationAnimator.class
      a-- 4/2/2013 3:52 PM 470 ViewModel.class
      a-- 4/2/2013 3:52 PM 1237 ViewPropertyAccessor$ElevationAccessor.class
      a-- 4/2/2013 3:52 PM 913 ViewPropertyAccessor$EyePositionAccessor.class
      a-- 4/2/2013 3:52 PM 876 ViewPropertyAccessor$HeadingAccessor.class
      a-- 4/2/2013 3:52 PM 868 ViewPropertyAccessor$PitchAccessor.class
      a-- 4/2/2013 3:52 PM 1422 ViewPropertyAccessor.class
      a-- 4/2/2013 3:52 PM 826 ViewPropertyLimits.class
      a-- 4/2/2013 3:52 PM 1366 ViewUtil$ViewState.class
      a-- 4/2/2013 3:52 PM 11575 ViewUtil.class

      After the clean I get:

      d---- 4/2/2013 4:43 PM firstperson
      d---- 4/2/2013 4:43 PM orbit
      a-- 4/2/2013 3:52 PM 1422 ViewPropertyAccessor.class

      As far as I can tell, there is no reason why this file should not have been removed.

          [JENKINS-17439] Perforce Quick Clean Does Not Remove All Build Files; Fails to Halt the Build

          Casey McGinty created issue -
          Casey McGinty made changes -
          Summary Original: Perforce quick clean failes to remove all files, failes to halt build New: Perforce Quick Clean Does Not Remove All Build Files; Fails to Halt the Build
          Casey McGinty made changes -
          Description Original: I hit a case where the Perforce "quick clean" option does not remove all of my class files.

          This leaves a class file in the /classes output directory, and when rebuilt, blocks the anonymous (MyClass$Anon.class) files from being generated, breaking the build.

          I do not see any error messages that indicate the root cause of this issue.

          This issues took me hours to track down and verify. If quick-clean had aborted the build when it fails, this would have saved a lot of headache.
          New: I hit a case where the Perforce "quick clean" option does not remove all of my class files.

          This leaves a class file in the /classes output directory, and when rebuilt, blocks the anonymous (MyClass$Anon.class) files from being generated, breaking the build.

          I do not see any error messages that indicate the root cause of this issue.

          This issues took me hours to track down and verify. If quick-clean had aborted the build when it fails, this would have saved a lot of headache.

          Here is failing directory before the clean:

          d---- 4/2/2013 3:52 PM firstperson
          d---- 4/2/2013 3:52 PM orbit
          -a--- 4/2/2013 3:52 PM 16553 BasicView.class
          -a--- 4/2/2013 3:52 PM 4859 BasicViewPropertyLimits.class
          -a--- 4/2/2013 3:52 PM 2793 ViewElevationAnimator.class
          -a--- 4/2/2013 3:52 PM 470 ViewModel.class
          -a--- 4/2/2013 3:52 PM 1237 ViewPropertyAccessor$ElevationAccessor.class
          -a--- 4/2/2013 3:52 PM 913 ViewPropertyAccessor$EyePositionAccessor.class
          -a--- 4/2/2013 3:52 PM 876 ViewPropertyAccessor$HeadingAccessor.class
          -a--- 4/2/2013 3:52 PM 868 ViewPropertyAccessor$PitchAccessor.class
          -a--- 4/2/2013 3:52 PM 1422 ViewPropertyAccessor.class
          -a--- 4/2/2013 3:52 PM 826 ViewPropertyLimits.class
          -a--- 4/2/2013 3:52 PM 1366 ViewUtil$ViewState.class
          -a--- 4/2/2013 3:52 PM 11575 ViewUtil.class

          After the clean I get:

          d---- 4/2/2013 4:43 PM firstperson
          d---- 4/2/2013 4:43 PM orbit
          -a--- 4/2/2013 3:52 PM 1422 ViewPropertyAccessor.class

          As far as I can tell, there is no reason why this file should not have been removed.

          Rob Petti added a comment - - edited

          Newer versions of Windows will sometimes allow a file to be silently "deleted" but it won't actually be removed from the file system until all open file handles have been closed. I'll double check to make sure that the plugin at least throws a warning if a file isn't deleted, but I don't believe there is a lot else that can be done.

          Rob Petti added a comment - - edited Newer versions of Windows will sometimes allow a file to be silently "deleted" but it won't actually be removed from the file system until all open file handles have been closed. I'll double check to make sure that the plugin at least throws a warning if a file isn't deleted, but I don't believe there is a lot else that can be done.

          Casey McGinty added a comment -

          Rob, I know windows file locking can make it tricky to delete files. However in this case, there were probably 1500 or more class files, and the only file not deleted was the only listed above. I was able to consistently reproduce this bug, so it wasn't just a one-off case. If there is some debug information I can turn on, then I can get you the output from Jenkins.

          Casey McGinty added a comment - Rob, I know windows file locking can make it tricky to delete files. However in this case, there were probably 1500 or more class files, and the only file not deleted was the only listed above. I was able to consistently reproduce this bug, so it wasn't just a one-off case. If there is some debug information I can turn on, then I can get you the output from Jenkins.

          Rob Petti added a comment -

          Assuming you have double checked to ensure the file in question has never been tracked by perforce, then I can't see why that file would be the only one ever missed. Unfortunately, there's no other debug information available. I will need to provide you with a custom build that contains additional debug output.

          Rob Petti added a comment - Assuming you have double checked to ensure the file in question has never been tracked by perforce, then I can't see why that file would be the only one ever missed. Unfortunately, there's no other debug information available. I will need to provide you with a custom build that contains additional debug output.

          Casey McGinty added a comment -

          It seems unlikely that file has been tracked before. I checked that is not currently tracked. If there is any other valid p4 command that I can run to check, let me know.

          Casey McGinty added a comment - It seems unlikely that file has been tracked before. I checked that is not currently tracked. If there is any other valid p4 command that I can run to check, let me know.

          Code changed in jenkins
          User: Rob Petti
          Path:
          src/main/java/hudson/plugins/perforce/QuickCleanerCall.java
          http://jenkins-ci.org/commit/perforce-plugin/644ad886249dbd8f2356fae1d1148a429a2ee95f
          Log:
          JENKINS-17439 add a warning if a file still exists after it is deleted

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/hudson/plugins/perforce/QuickCleanerCall.java http://jenkins-ci.org/commit/perforce-plugin/644ad886249dbd8f2356fae1d1148a429a2ee95f Log: JENKINS-17439 add a warning if a file still exists after it is deleted

          Alexey Larsky added a comment - - edited

          Perforce "quick clean" doesn't remove ANY UNTRACKED file!
          Jenkins 1.532.2
          Perforce 1.3.27

          Alexey Larsky added a comment - - edited Perforce "quick clean" doesn't remove ANY UNTRACKED file! Jenkins 1.532.2 Perforce 1.3.27

          Rob Petti added a comment -

          Are you getting any warnings? What os are you using? This works fine for me in production.

          Rob Petti added a comment - Are you getting any warnings? What os are you using? This works fine for me in production.

            Unassigned Unassigned
            cmcginty Casey McGinty
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: