Hello,

       

      When cancelling a p4 sync, the files are locked and it is not possible to run another build until restarting Jenkins service.

      Tested with latest P4 plugin (1.11.4) and the issue is reproducible 100% in our environment.

      This issue seems very similar to https://issues.jenkins.io/browse/JENKINS-37487 which has been marked as resolved.

       

      Could you please help fixing the issue?

       

      [Pipeline] End of Pipeline
      ERROR: P4: Task Exception: java.io.IOException: Unable to delete file: C:\Jenkins\workspace\Vulcan\1.7\Unity_2
      Finished: FAILURE
      

      thanks a lot,

      Marius

          [JENKINS-65418] Cancelling p4 sync results in locked files

          Marius created issue -
          Marius made changes -
          Description Original: Hello,

           

          When cancelling a p4 sync, the files are locked and it is not possible to run another build until restarting Jenkins service.

          Tested with latest P4 plugin (1.11.4) and the issue is reproducible 100% in our environment.

          Could you please help fixing the issue?

           
          {code:java}
          [Pipeline] End of Pipeline
          ERROR: P4: Task Exception: java.io.IOException: Unable to delete file: C:\Jenkins\workspace\Vulcan\1.7\Unity_2
          Finished: FAILURE
          {code}
          thanks a lot,

          Marius
          New: Hello,

           

          When cancelling a p4 sync, the files are locked and it is not possible to run another build until restarting Jenkins service.

          Tested with latest P4 plugin (1.11.4) and the issue is reproducible 100% in our environment.

          This issue seems very similar to https://issues.jenkins.io/browse/JENKINS-37487 which has been marked as resolved.

           

          Could you please help fixing the issue?

           
          {code:java}
          [Pipeline] End of Pipeline
          ERROR: P4: Task Exception: java.io.IOException: Unable to delete file: C:\Jenkins\workspace\Vulcan\1.7\Unity_2
          Finished: FAILURE
          {code}
          thanks a lot,

          Marius

          Karl Wirth added a comment -

          Hi maneamarius  - Thanks for highlighting this. How did you test the cancelling the job? Do you abort the job during a sync of a big file?

          Whats the organic reason that this occurs in your environment? For example do you need to abort jobs in certain circumstances?

          Karl Wirth added a comment - Hi maneamarius   - Thanks for highlighting this. How did you test the cancelling the job? Do you abort the job during a sync of a big file? Whats the organic reason that this occurs in your environment? For example do you need to abort jobs in certain circumstances?

          Marius added a comment -

          We don't have a specific need for this feature, but it may happens sometimes people realize they start the job with wrong parameters and they try to cancel the job right away.

          It happened serveral times before and only by restarting the jenkins service we can fix it (which can be a problem, if we have builds that are running - some of them take hours to complete).

          Hence, the need to have this fixed.

          Regarding your other question, the sync is not on a big file, but it's a rather large repo (see below)

           

          13:01:28 P4 Task: syncing files at change: 41019
          13:01:28 (p4):cmd:... p4 sync -p -q C:\Jenkins\workspace\Vulcan\1.7\Unity/...@41019
          13:01:29 ... totalFileSize 20500235028
          13:01:29 ... totalFileCount 36087
          13:01:29
          13:01:29 ... totalFileSize 20500235028
          13:01:29 ... totalFileCount 36087

          Marius added a comment - We don't have a specific need for this feature, but it may happens sometimes people realize they start the job with wrong parameters and they try to cancel the job right away. It happened serveral times before and only by restarting the jenkins service we can fix it (which can be a problem, if we have builds that are running - some of them take hours to complete). Hence, the need to have this fixed. Regarding your other question, the sync is not on a big file, but it's a rather large repo (see below)   13:01:28 P4 Task: syncing files at change: 41019 13:01:28 (p4):cmd:... p4 sync -p -q C:\Jenkins\workspace\Vulcan\1.7\Unity/...@41019 13:01:29 ... totalFileSize 20500235028 13:01:29 ... totalFileCount 36087 13:01:29 13:01:29 ... totalFileSize 20500235028 13:01:29 ... totalFileCount 36087

          Karl Wirth added a comment -

          Hi maneamarius,

          Thanks for the information. I'll try and repro this here and will let you know if I can.

          Karl Wirth added a comment - Hi maneamarius , Thanks for the information. I'll try and repro this here and will let you know if I can.
          Karl Wirth made changes -
          Assignee New: Karl Wirth [ p4karl ]
          Karl Wirth made changes -
          Labels Original: p4 p4-plugin p4plugin plugin New: P4_SUPPORT p4 p4-plugin p4plugin plugin

          Marius added a comment -

          Thank you, I appreciate your help with this!

          Marius added a comment - Thank you, I appreciate your help with this!
          Karl Wirth made changes -
          Attachment New: HangingLock.png [ 54657 ]

          Karl Wirth added a comment - - edited

          Easily able to reproduce this.

          (1) Point at P4D server with millions of files.

          (2) Start any job with a forced Sync using a Windows slave.

          (3) Click the red abort icon.

          (4) Try to delete the workspace folder get an error that a file is locked.

          (5) Use the 'SysInternals' program 'handle' shows the file that is locked:

           

          Karl Wirth added a comment - - edited Easily able to reproduce this. (1) Point at P4D server with millions of files. (2) Start any job with a forced Sync using a Windows slave. (3) Click the red abort icon. (4) Try to delete the workspace folder get an error that a file is locked. (5) Use the 'SysInternals' program 'handle' shows the file that is locked:  

            Unassigned Unassigned
            maneamarius Marius
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: