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

Using p4 groovy on depots that take longer than 5 minutes to sync see InterruptedException.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins 2.292 | P4 Plugin 1.11.5

      If you try doing any operations with p4 groovy that last longer than 5 minutes, jenkins kills the build as failure:

      Doing this for example on a very large depot that would result in more than 5 minutes of sync time causes the exception.

      def p4Object = p4(credential: credentialsId, workspace: workspace)
      p4Object.run('sync')
      

      Ideally this should behave the same as the normal checkout that occasionally gives back time to the thread so other things can process and does the normal "..tick.." messages to keep the process alive.

          [JENKINS-65643] Using p4 groovy on depots that take longer than 5 minutes to sync see InterruptedException.

          David added a comment - - edited

          Any plans to revisit this? This is related to https://issues.jenkins.io/browse/JENKINS-58161 which was closed citing https://issues.jenkins.io/browse/JENKINS-58817 as blocking the issue.

          However, after that happened more commentary was made here: https://github.com/jenkinsci/workflow-cps-plugin/pull/313#issuecomment-548070971 stating this work should be done in an async step not directly during a cps remote call. If that happens it  should operate as desired.

          I am not familiar with the architecture of the plugin, is this possible to make this adjustment for p4.run? This is a very frustrating issue.

          David added a comment - - edited Any plans to revisit this? This is related to https://issues.jenkins.io/browse/JENKINS-58161 which was closed citing https://issues.jenkins.io/browse/JENKINS-58817 as blocking the issue. However, after that happened more commentary was made here: https://github.com/jenkinsci/workflow-cps-plugin/pull/313#issuecomment-548070971 stating this work should be done in an async step not directly during a cps remote call. If that happens it   should operate as desired. I am not familiar with the architecture of the plugin, is this possible to make this adjustment for p4.run? This is a very frustrating issue.

          David added a comment -

          This issue is preventing our project from using the p4 groovy features at all. 5 minutes is a very short time when depots are large, for example for game development. And checkout and p4synch commands do not provide enough control over the details of the sync behavior.

          David added a comment - This issue is preventing our project from using the p4 groovy features at all. 5 minutes is a very short time when depots are large, for example for game development. And checkout and p4synch commands do not provide enough control over the details of the sync behavior.

          Dhaval added a comment - - edited

          dali_54698 This problem is a limitation is groovy streaming itself. Not the problem with p4plugin that we can fix.

          See the jenkins link for details.

          https://github.com/jenkinsci/workflow-cps-plugin/pull/313#issuecomment-548070971

          p4karl skumar7322 

          Dhaval added a comment - - edited dali_54698 This problem is a limitation is groovy streaming itself. Not the problem with p4plugin that we can fix. See the jenkins link for details. https://github.com/jenkinsci/workflow-cps-plugin/pull/313#issuecomment-548070971 p4karl skumar7322  

          David added a comment - - edited

          Cheers for the response patdhaval30. I am no expert in Groovy or Java so bear that in mind. But I would like to present an example that indicates to me that it is possible to have script calls that don't time out due to this limit.

          The following pipeline code can run (in a script block inside a pipeline step) for hours and complete the synch:

          p4sync(credential: 'project-perforce-read',
                      format: 'jenkins-NODE_NAME-JOB_NAME-EXECUTOR_NUMBER'
                      populate: syncOnly(force: false, have: true, quiet: true),
                      source: streamSource('//project/main'))

          While the following "p4.run()" command will time out after 5 minutes (in a script block inside a pipeline step):

          def p4 = p4(credential: 'project-perforce-read', 
                      workspace: manualSpec(name: 'jenkins-NODE_NAME-JOB_NAME-EXECUTOR_NUMBER'
                                            spec: clientSpec(allwrite: true, backup: false, streamName: project/main',  view: '')))
          p4.run('sync', '//project/main/...') 

          That combined with the closing comments for the issue mentioned by dclyde_brghttps://github.com/jenkinsci/workflow-cps-plugin/pull/313#issuecomment-548070971 ), is an indication to me that P4 Groovy commands could be implemented in a different way that doesn't hit the 5 minute timeout.

          If there is not and this is truly an unsolvable dead end for P4 Groovy, then thank you for taking the time to look closer at the issue.

          Minor note: Omitted $ and brackets in workspace name variables above due to auto-formatting rules in the issue browser.

          David added a comment - - edited Cheers for the response patdhaval30 . I am no expert in Groovy or Java so bear that in mind. But I would like to present an example that indicates to me that it is possible to have script calls that don't time out due to this limit. The following pipeline code can run (in a script block inside a pipeline step) for hours and complete the synch: p4sync(credential: 'project-perforce-read',             format: ' jenkins-NODE_NAME- JOB_NAME-EXECUTOR_NUMBER '             populate: syncOnly(force: false, have: true, quiet: true),             source: streamSource('//project/main')) While the following "p4.run()" command will time out after 5 minutes (in a script block inside a pipeline step): def p4 = p4(credential: 'project-perforce-read',              workspace: manualSpec(name: ' jenkins-NODE_NAME- JOB_NAME-EXECUTOR_NUMBER ' ,                                    spec: clientSpec( allwrite: true, b ackup: false, streamName: project/main',   view: ''))) p4.run('sync', '//project/main/...')  That combined with the closing comments for the issue mentioned by dclyde_brg (  https://github.com/jenkinsci/workflow-cps-plugin/pull/313#issuecomment-548070971 ), is an indication to me that P4 Groovy commands could be implemented in a different way that doesn't hit the 5 minute timeout. If there is not and this is truly an unsolvable dead end for P4 Groovy, then thank you for taking the time to look closer at the issue. Minor note: Omitted $ and brackets in workspace name variables above due to auto-formatting rules in the issue browser.

          Dhaval added a comment -

          Thanks dali_54698 . We will take a one more closer look at the issue.

          Dhaval added a comment - Thanks dali_54698 . We will take a one more closer look at the issue.

            Unassigned Unassigned
            kyates Keith Yates
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: