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

Client MODTIME is not set using source: depotSource(spec)

      We are using the p4sync step in the following way, inside our pipeline to sync some thirdparty libraries:

      p4sync charset: 'none',
          credential: 'p4-buildserver-credentials',
          format: "j-\${NODE_NAME}-\${JOB_NAME}-\${EXECUTOR_NUMBER}-${suffix}",
          populate: autoClean(
              delete: true,
              modtime: true,
              parallel: [
                  enable: true, minbytes: '1024', minfiles: '1', threads: '8'
              ],
              pin: "$env.GLOBAL_P4_CHANGELIST",
              quiet: true,
              replace: true,
              tidy: false
          ),
          source: depotSource(spec) // spec is a variable defined elsewhere
      

      The problem seems to be that the modtime: true appears to be useless, because the workspace as created in perforce does not have the MODTIME option set so files are not being synced with the modification time from the depot, and are having their modification times updated each time by the p4 reconcile command.

      An argument to depoSource to specify that the workspace should have modtime enabled seems like it would be very useful.

      Alternatively, perhaps the modtime and other options should be passed to the workspace spec here:
      https://swarm.workshop.perforce.com/projects/p4-jenkins/files/main/src/main/java/org/jenkinsci/plugins/p4/workflow/source/DepotSource.java#33

          [JENKINS-55253] Client MODTIME is not set using source: depotSource(spec)

          Seems like this report may have been a bit premature - I'm seeing the expected behaviour after a few builds have populated the workspaces of most of our nodes.

          Does the workspace MODTIME option not have influence over the -m option for p4 reconcile?

          Alisdair Robertson added a comment - Seems like this report may have been a bit premature - I'm seeing the expected behaviour after a few builds have populated the workspaces of most of our nodes. Does the workspace MODTIME option not have influence over the -m option for p4 reconcile?

          Karl Wirth added a comment -

          The following option in the 'p4sync' syntax generator is misleading:

          It refers to a performance option on the reconcile command:

          	The -m flag used in conjunction with -e can be used to minimize
          	costly digest computation on the client by checking file modification
          	times before checking digests to determine if files have been
          	modified outside of Perforce.
          
          

          If date stamp on file is the same assume the file has not been touched. If it differs from the stamp in the database run the costly digest calculation. For example to calculate digest of a 10GB file all 10GB needs to be read from agent disk. This skips that read.

           

          Karl Wirth added a comment - The following option in the 'p4sync' syntax generator is misleading: It refers to a performance option on the reconcile command: The -m flag used in conjunction with -e can be used to minimize costly digest computation on the client by checking file modification times before checking digests to determine if files have been modified outside of Perforce. If date stamp on file is the same assume the file has not been touched. If it differs from the stamp in the database run the costly digest calculation. For example to calculate digest of a 10GB file all 10GB needs to be read from agent disk. This skips that read.  

          Karl Wirth added a comment -

          Closing for now. Th echeckbox control the '-m' option being appended to 'reconcile' and is not related to sync modtime.

           

          Please feel free to reopen if you have further questions.

          Karl Wirth added a comment - Closing for now. Th echeckbox control the '-m' option being appended to 'reconcile' and is not related to sync modtime.   Please feel free to reopen if you have further questions.

            p4karl Karl Wirth
            alisdair_robertson Alisdair Robertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: