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

P4 plugin keeps triggering builds on the same Perforce changelist, even if no new changelist was submitted to Perforce.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins version: 1.626, Perforce Plugin version: 1.3.35

      I noticed that the P4 plugin keeps triggering builds on the same Perforce changelist even if no new changelist was submitted to Perforce. I had a look at the polling log and it seems like the "p4 counter change" command is used by the p4 plugin to determine the latest changelist available on Perforce ( see log at the end of this message ). This is probably wrong, since the Perforce doc (https://www.perforce.com/perforce/r12.2/manuals/cmdref/counter.html) says that this command returns "The last changelist number known to the Perforce service (the output of p4 counter change) includes pending changelists created by users, but not yet submitted to the depot. ". This probably explains the bug, since the plugin triggers a build as long as somebody has a pending changelist in his workspace whose changelist number is higher than the last submitted changelist.

      Started on Jan 19, 2016 1:01:00 PM
      Polling SCM changes on BUILDMACHINE
      Looking for changes...
      Using node: BUILDMACHINE
      Using remote perforce client: build_basic-1162883061
      [Jenkins] $ p4 workspace -o build_basic-1162883061
      [Jenkins] $ p4 counter change
      [Jenkins] $ p4 -s changes -s submitted //SecretPath/...@176960,@329345
      Latest submitted change selected by workspace is 329343
      [Jenkins] $ p4 describe -s 329343
      [Jenkins] $ p4 info
      [Jenkins] $ p4 -G where //...
      Looking for changes...
      Using node: BUILDMACHINE
      Using remote perforce client: Build_BuildScripts-1162883061
      [Jenkins] $ p4 workspace -o Build_BuildScripts-1162883061
      [Jenkins] $ p4 counter change
      [Jenkins] $ p4 -s changes -s submitted //Build_BuildScripts-1162883061/...@176960,@189267
      No changes found.
      Done. Took 17 sec
      Changes found

          [JENKINS-32523] P4 plugin keeps triggering builds on the same Perforce changelist, even if no new changelist was submitted to Perforce.

          Robby Pocase added a comment - - edited

          I've seen this issue on and off for months now across various jobs. I'm not sure if its specifically related to pending changelists, though. I have a job now that doesn't have any pending changelists (unless there are some in default) that is in the constant queuing state.

          Edit: My comment was based on this being an issue against "p4-plugin".

          Robby Pocase added a comment - - edited I've seen this issue on and off for months now across various jobs. I'm not sure if its specifically related to pending changelists, though. I have a job now that doesn't have any pending changelists (unless there are some in default) that is in the constant queuing state. Edit: My comment was based on this being an issue against "p4-plugin".

          Steve Robbins added a comment -

          Are you possibly using "Forced clean and sync"? That option causes this behaviour for me; c.f. JENKINS-32518.

          Steve Robbins added a comment - Are you possibly using "Forced clean and sync"? That option causes this behaviour for me; c.f. JENKINS-32518 .

          My apologies, I just noticed we are using the Perforce Plugin, not the P4 Plugin. There is no "Forced clean and sync" option in the Perforce Plugin, so this is not the problem. I updated the info in this bug description accordingly. Sorry for the confusion.

          Stéphane Pelletier added a comment - My apologies, I just noticed we are using the Perforce Plugin, not the P4 Plugin. There is no "Forced clean and sync" option in the Perforce Plugin, so this is not the problem. I updated the info in this bug description accordingly. Sorry for the confusion.

          Code changed in jenkins
          User: Paul Allen
          Path:
          src/main/java/org/jenkinsci/plugins/p4/changes/P4Revision.java
          src/main/java/org/jenkinsci/plugins/p4/client/ClientHelper.java
          src/main/java/org/jenkinsci/plugins/p4/tasks/PollTask.java
          http://jenkins-ci.org/commit/p4-plugin/cad43ac74895c7569ada4c3306731c044d75ce7b
          Log:
          Track syncs with a 'Change' field in the Workspace Description.

          Polling used ‘p4 cstat’ to determine the last sync’ed change in a
          workspace. However, if the have list is empty (such as in the Force
          Clean Populate mode) it would appear as if no changes have been synced.

          JENKINS-32518
          JENKINS-32523

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: src/main/java/org/jenkinsci/plugins/p4/changes/P4Revision.java src/main/java/org/jenkinsci/plugins/p4/client/ClientHelper.java src/main/java/org/jenkinsci/plugins/p4/tasks/PollTask.java http://jenkins-ci.org/commit/p4-plugin/cad43ac74895c7569ada4c3306731c044d75ce7b Log: Track syncs with a 'Change' field in the Workspace Description. Polling used ‘p4 cstat’ to determine the last sync’ed change in a workspace. However, if the have list is empty (such as in the Force Clean Populate mode) it would appear as if no changes have been synced. JENKINS-32518 JENKINS-32523

          Paul Allen added a comment -

          Slated for next release

          Paul Allen added a comment - Slated for next release

          Paul Allen added a comment -

          Released in 1.3.9

          Paul Allen added a comment - Released in 1.3.9

            p4paul Paul Allen
            spelletier Stéphane Pelletier
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: