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

p4jenksin not pickup latest changes

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Component/s: p4-plugin
    • Labels:
      None
    • Environment:
      linux
    • Similar Issues:

      Description

      p4jenkins version 2.4 using java 8

      I have encountered a number of occasions where p4jekins does not seem to pick up latest changes. This is a hard problem to trace and hard to reproduce. Finally, today I am able to capture. Need some help on how to collect more info for troubleshooting purpose.

      Clean the workspace does not help

      The workaround to manually remove the files under jenkins' jobs/${jobName} directory except config.xml

        Attachments

          Issue Links

            Activity

            Hide
            p4paul Paul Allen added a comment -

            Please can you send me the full console log, and expand the sections used to clean and sync the workspace.

            Show
            p4paul Paul Allen added a comment - Please can you send me the full console log, and expand the sections used to clean and sync the workspace.
            Hide
            hshah Harsh Shah added a comment -

            Here is the console log attached. The log shows that it keeps checking for the new changes but finds same changes changes and considers the change as a new change.

            Show
            hshah Harsh Shah added a comment - Here is the console log attached. The log shows that it keeps checking for the new changes but finds same changes changes and considers the change as a new change.
            Hide
            p4paul Paul Allen added a comment -

            When you say it does not seem to pick up the latest changes are you missing change numbers from the list? or files from within the changes? Are the missing changes submitted changes or shelved changes?

            The plugin detected the last change (within the scope of the workspace view) as 580647. It calculates this at the time of the build, so changes submitted after the build are not included.

            The only situation when this is not true is if the 'Pin build at Perforce Label' option is used or a 'Polling Filter' is set.

            Have you recently changed your workspace mapping? Please can you include the mapping if it is more complicated than a simple 1:1 mapping.

            Show
            p4paul Paul Allen added a comment - When you say it does not seem to pick up the latest changes are you missing change numbers from the list? or files from within the changes? Are the missing changes submitted changes or shelved changes? The plugin detected the last change (within the scope of the workspace view) as 580647. It calculates this at the time of the build, so changes submitted after the build are not included. The only situation when this is not true is if the 'Pin build at Perforce Label' option is used or a 'Polling Filter' is set. Have you recently changed your workspace mapping? Please can you include the mapping if it is more complicated than a simple 1:1 mapping.
            Hide
            hshah Harsh Shah added a comment -

            Thanks for your input Allen. The mapping is complicated and has multiple mappings for two repos in perforce. Due to NDA issues we cannot share the mapping. But one thing that struck my mind which could be the cause of the problem. Inside Jenkins job configuration we get options to provide regex for build triggers.
            Following are two options in the build triggers section:-
            1 Build periodically
            2 Poll SCM

            I am just using the poll SCM option to trigger this build every Tuesday of a week. Does this effect the change list being fetched for the build? I mean will it fetch the changes between Tuesday to Tuesday only?

            for example
            If a manual build is performed on Friday will the change list be fetched only till last Tuesday and changes that occurred on Wednesday, Thursday and Friday will not be present in the change list.

            Show
            hshah Harsh Shah added a comment - Thanks for your input Allen. The mapping is complicated and has multiple mappings for two repos in perforce. Due to NDA issues we cannot share the mapping. But one thing that struck my mind which could be the cause of the problem. Inside Jenkins job configuration we get options to provide regex for build triggers. Following are two options in the build triggers section:- 1 Build periodically 2 Poll SCM I am just using the poll SCM option to trigger this build every Tuesday of a week. Does this effect the change list being fetched for the build? I mean will it fetch the changes between Tuesday to Tuesday only? for example If a manual build is performed on Friday will the change list be fetched only till last Tuesday and changes that occurred on Wednesday, Thursday and Friday will not be present in the change list.
            Hide
            p4paul Paul Allen added a comment -

            Both a scheduled 'Poll SCM' and a 'Build Now' build will use the latest Perforce change at the point when they are triggered (unless of course a Poll Filter or 'Pin build at Perforce Label' option is set).

            In effect Poll SCM is calling Build Now at the time defined by the cron event.

            Regarding your NDA issues, if you have a support agreement with Perforce, please open a ticket (referring to this Jira issue). I can then help our support team out as needed.

            Show
            p4paul Paul Allen added a comment - Both a scheduled 'Poll SCM' and a 'Build Now' build will use the latest Perforce change at the point when they are triggered (unless of course a Poll Filter or 'Pin build at Perforce Label' option is set). In effect Poll SCM is calling Build Now at the time defined by the cron event. Regarding your NDA issues, if you have a support agreement with Perforce, please open a ticket (referring to this Jira issue). I can then help our support team out as needed.
            Hide
            mrose Michael Rose added a comment -

            Both a scheduled 'Poll SCM' and a 'Build Now' build will use the latest Perforce change at the point when they are triggered (unless of course a Poll Filter or 'Pin build at Perforce Label' option is set).

            I have noticed that there are times when this is not true. The plugin seems to get in a weird state where it holds on to an old changelist. This just happened earlier today. Notice the "p4 changes -m" says that the latest changelist is 141219 but the changelist that it decided to sync was 140984.

            00:00:00.177 ... client: jenkins-master-ndica-main
            00:00:00.209
            ... p4 client -o jenkins-master-ndica-main +
            00:00:00.221
            ... p4 counter change +
            00:00:00.236
            ... p4 changes -m1 //jenkins-master-ndica-main/... -
            00:00:00.236 p4 changes -m1 //jenkins-master-ndica-main/...
            00:00:00.236
            00:00:00.243 Change 141219 on 2015/09/15 by ... 'Copying ...'
            00:00:00.243
            00:00:00.243 Building Parent on Node: master
            00:00:00.280
            ... p4 client -o jenkins-master-ndica-main +
            00:00:00.363
            00:00:00.363 P4 Task: establishing connection.
            <snip>
            00:00:00.363
            00:00:00.363 P4 Task: reverting all pending and shelved revisions.
            00:00:00.364
            ... p4 revert /jenkins/workspaces/ndica/main/... +
            00:00:00.369 ... rm [abandoned files]
            00:00:00.369 duration: (6ms)
            00:00:00.369
            00:00:00.369 P4 Task: syncing files at change: 0
            00:00:00.370
            ... p4 sync -f /jenkins/workspaces/ndica/main/...@0 +
            00:00:00.450 duration: (81ms)
            00:00:00.450
            00:00:00.450 ... rm -rf /jenkins/workspaces/ndica/main
            00:00:00.453 P4 Task: syncing files at change: 140984
            00:00:00.454
            ... p4 sync -f /jenkins/workspaces/ndica/main/...@140984 +
            00:00:00.820 duration: (367ms)
            00:00:00.820
            00:00:00.820 P4 Task: saving built changes.
            00:00:00.850

            Usually when this happens, I restart Jenkins and everything goes back to working order.

            Show
            mrose Michael Rose added a comment - Both a scheduled 'Poll SCM' and a 'Build Now' build will use the latest Perforce change at the point when they are triggered (unless of course a Poll Filter or 'Pin build at Perforce Label' option is set). I have noticed that there are times when this is not true. The plugin seems to get in a weird state where it holds on to an old changelist. This just happened earlier today. Notice the "p4 changes -m" says that the latest changelist is 141219 but the changelist that it decided to sync was 140984. 00:00:00.177 ... client: jenkins-master-ndica-main 00:00:00.209 ... p4 client -o jenkins-master-ndica-main + 00:00:00.221 ... p4 counter change + 00:00:00.236 ... p4 changes -m1 //jenkins-master-ndica-main/... - 00:00:00.236 p4 changes -m1 //jenkins-master-ndica-main/... 00:00:00.236 00:00:00.243 Change 141219 on 2015/09/15 by ... 'Copying ...' 00:00:00.243 00:00:00.243 Building Parent on Node: master 00:00:00.280 ... p4 client -o jenkins-master-ndica-main + 00:00:00.363 00:00:00.363 P4 Task: establishing connection. <snip> 00:00:00.363 00:00:00.363 P4 Task: reverting all pending and shelved revisions. 00:00:00.364 ... p4 revert /jenkins/workspaces/ndica/main/... + 00:00:00.369 ... rm [abandoned files] 00:00:00.369 duration: (6ms) 00:00:00.369 00:00:00.369 P4 Task: syncing files at change: 0 00:00:00.370 ... p4 sync -f /jenkins/workspaces/ndica/main/...@0 + 00:00:00.450 duration: (81ms) 00:00:00.450 00:00:00.450 ... rm -rf /jenkins/workspaces/ndica/main 00:00:00.453 P4 Task: syncing files at change: 140984 00:00:00.454 ... p4 sync -f /jenkins/workspaces/ndica/main/...@140984 + 00:00:00.820 duration: (367ms) 00:00:00.820 00:00:00.820 P4 Task: saving built changes. 00:00:00.850 Usually when this happens, I restart Jenkins and everything goes back to working order.
            Hide
            p4paul Paul Allen added a comment -

            Cleaning up old issue - closing

            Show
            p4paul Paul Allen added a comment - Cleaning up old issue - closing

              People

              • Assignee:
                Unassigned
                Reporter:
                dantran dan tran
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: