[ 
https://issues.jenkins-ci.org/browse/JENKINS-13879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163142#comment-163142
 ] 

Rob Petti commented on JENKINS-13879:
-------------------------------------

It already uses 'p4 changes -m 1 -s'. 'p4 counter change' is only used when 
looking for the actual latest change in the workspace. Here's an example from 
one of my own build logs:
{code}
[workspace] $ p4 counter change
[workspace] $ p4 -s changes -s submitted //installer/...@260018,@260111
[workspace] $ p4 describe -s 260103
...
Sync'ing workspace to changelist 260103.
[workspace] $ p4 -s sync //installer/...@260103
{code}
'p4 counter change' returns 260111, but as you can see, it's using the last 
changeset that was submitted in the view for syncing.

In the cases where you've seen different behavior, were there any changes made 
at all? I suspect it may be falling back onto the value provided by the counter 
when there are no changes available in the view, which is of course incorrect 
behavior.
                
> Builds failing to trigger due to changelist number being set incorrectly
> ------------------------------------------------------------------------
>
>                 Key: JENKINS-13879
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-13879
>             Project: Jenkins
>          Issue Type: Bug
>          Components: perforce
>         Environment: Jenkins 1.462, Perforce plugin 1.3.13
>            Reporter: Jeremy Frank
>
> When a job is run, the Perforce plugin for Jenkins records a changelist 
> number for the build instance. From that point forward, triggering additional 
> builds via Perforce only happens when new changelists are submitted with 
> numbers higher than the recorded changelist number. Great, except that the 
> recorded changelist number may not be correct.
> For example, if the most recent changelists look like this (from "p4 
> changelists -m 2"):
>     Change 24083 on 2012/05/23 by rmercer@rmercer-DcsMain *pending* 'The 
> adapter layer now returns D'
>     Change 24082 on 2012/05/23 by reladmin@jenkins-aci-RILCinterion-QA-2 
> 'Check in server build result fo'
> and a build starts (either via the Build Now button, or because of 24082 
> being submitted), the Perforce plugin runs "p4 counter change" and records 
> 24083 as the changelist number. Note that 24083 is a *pending* changelist.
> Further polling will fail to detect that 24083 was submitted. No build will 
> result. Oops, the latest "reserved" changelist number was recorded, rather 
> than the latest "submitted" changelist number.
> Often this problem is masked because new changelist numbers get generated 
> upon a checkin, but not always. Perforce only renumbers a changelist upon 
> checkin if there are intervening changelists.
> Suggested solution: Rather than using "p4 counter change" to detect the 
> current changelist number, please use "p4 changelists -m 1 -s submitted".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to