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

p4sync in parallel causes invalid SCM triggering

      I have a very basic pipeline job with SCM polling that runs p4sync in parallel on separate nodes with separate workspaces. Unfortunately this job triggers over and over again and I believe this is caused by a bug in the P4 Plugin.

      Pipeline script:

      def generateBranches() {
        def branches = [:]
        branches["Branch-0"] = {
          node('some_node') {
            p4sync credential: 'perforce-tst', format: "jenkins-${NODE_NAME}-${JOB_NAME}-Branch-0", depotPath: "//product1/main", populate: [$class: 'ForceCleanImpl', quiet: true]
          }
        }
        branches["Branch-1"] = {
          node('some_node') {
            p4sync credential: 'perforce-tst', format: "jenkins-${NODE_NAME}-${JOB_NAME}-Branch-1", depotPath: "//product1/main", populate: [$class: 'ForceCleanImpl', quiet: true]
          }
        }
        return branches
      }
      
      stage("Checkout") {
        parallel generateBranches()
      }
      

      Polling log from invalid trigger:

      Started on Apr 21, 2017 6:24:05 PM
      P4: Polling on: master with:jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-0
      Found last change 2053609 on syncID jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-0
      (p4):cmd:... p4 client -o jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-0
      p4 client -o jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-0
      
      Perforce password (P4PASSWD) invalid or unset.
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      
      P4 Task: establishing connection.
      ... server: perforce-tst.miclaser.net:1777
      ... node: jenkins-mw
      P4: Polling with range: 2053609,now
      (p4):cmd:... p4 changes //jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-0/.___
      p4 changes //jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-0/...@2053609,now
      
      Change 2053609 on 2017/04/20 by 9675frerev@9675frerev_se-dt-3170_TEST 'Jenkins trigger test #4
      '
      (p4):stop:6
      P4: Polling on: master with:jenkins-vs-docker-deb8-amd64-1-test_jobs-trigger-test-job-3-Branch-1
      Done. Took 60 ms
      Changes found
      

          [JENKINS-43770] p4sync in parallel causes invalid SCM triggering

          Kun Tang added a comment -

          I've submitted one fix for this issue: https://github.com/jenkinsci/p4-plugin/pull/42.

          Kun Tang added a comment - I've submitted one fix for this issue: https://github.com/jenkinsci/p4-plugin/pull/42 .

          Code changed in jenkins
          User: Kun Tang
          Path:
          src/main/java/org/jenkinsci/plugins/p4/tagging/TagAction.java
          src/test/java/org/jenkinsci/plugins/p4/client/JenkinsfileTest.java
          http://jenkins-ci.org/commit/p4-plugin/60bdd48e349058a40c44c8d701248c54974662ab
          Log:
          p4sync in parallel causes invalid SCM triggering

          JENKINS-43770

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kun Tang Path: src/main/java/org/jenkinsci/plugins/p4/tagging/TagAction.java src/test/java/org/jenkinsci/plugins/p4/client/JenkinsfileTest.java http://jenkins-ci.org/commit/p4-plugin/60bdd48e349058a40c44c8d701248c54974662ab Log: p4sync in parallel causes invalid SCM triggering JENKINS-43770

          Code changed in jenkins
          User: Paul Allen
          Path:
          src/main/java/org/jenkinsci/plugins/p4/tagging/TagAction.java
          src/test/java/org/jenkinsci/plugins/p4/client/JenkinsfileTest.java
          http://jenkins-ci.org/commit/p4-plugin/b75bdca411990806fde1f2e1b5d5113128a226bc
          Log:
          Merge pull request #42 from tangkun75/JENKINS-43770_p4sync_in_parallel_causes_invalid_SCM_triggering

          JENKINS-43770 p4sync in parallel causes invalid SCM triggering

          Compare: https://github.com/jenkinsci/p4-plugin/compare/880b2a4a498d...b75bdca41199

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: src/main/java/org/jenkinsci/plugins/p4/tagging/TagAction.java src/test/java/org/jenkinsci/plugins/p4/client/JenkinsfileTest.java http://jenkins-ci.org/commit/p4-plugin/b75bdca411990806fde1f2e1b5d5113128a226bc Log: Merge pull request #42 from tangkun75/ JENKINS-43770 _p4sync_in_parallel_causes_invalid_SCM_triggering JENKINS-43770 p4sync in parallel causes invalid SCM triggering Compare: https://github.com/jenkinsci/p4-plugin/compare/880b2a4a498d...b75bdca41199

          Kun Tang added a comment -

          The code changes has been accepted and merged.

          Kun Tang added a comment - The code changes has been accepted and merged.

          Paul Allen added a comment -

          Released 1.6.1

          Paul Allen added a comment - Released 1.6.1

            tangkun75 Kun Tang
            chetic Fredrik Reveny
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: