[JIRA] (JENKINS-56037) SCM Polling with p4-plugin triggers builds several times

0 views
Skip to first unread message

jeffrey@thatgamecompany.com (JIRA)

unread,
Feb 7, 2019, 2:57:02 PM2/7/19
to jenkinsc...@googlegroups.com
Jeffrey Exterkate created an issue
 
Jenkins / Bug JENKINS-56037
SCM Polling with p4-plugin triggers builds several times
Issue Type: Bug Bug
Assignee: Unassigned
Components: p4-plugin
Created: 2019-02-07 19:56
Environment: Latest Jenkins version, latest p4-plugin version, scripted pipeline jobs
Priority: Blocker Blocker
Reporter: Jeffrey Exterkate

We have 2 jobs with different workspaces that do SCM polling every 2 minutes (with different filters) that could potentially be triggered at roughly the same time (as polling has a random fudge factor). If the longer job (5 minutes) runs first and then the other one will be polling as well, then it could happen that it polls one or two more times before it can actually run, the end result being that once the longer job finishes, the short job runs 3 times in a row, once with the change it should have been building, then two more times with no changes, but the logs will still say it was triggered because it did detect changes. Then as a bonus sometimes even the long job will run again with no changes, but a polling log saying that there were changes detected even though not saying which ones.

It gets worse still, as in this scenario sometimes it even builds a job when it should not have detected changes due to the filter we supplied and then to make it worse still also build that multiple times with no changes (same changelist number).

Then last of all, when a job does get triggered due to one out of many changes being filtered as positive, still all changes are reported to the job and not just the change that triggered it. Which is inconvenient for our slack notification code showing changes that were unrelated.

It is also unclear how to achieve the desired results if we were to switch to perforce triggers instead of polling, as the documentation is vague about the filters applying only to polling or also to p4 triggering.

We use a Jenkinsfile with scripted pipeline (not declarative) and as Jenkins UI for editing the script is not great and the serialization of the pipeline script to XML seems to be verbatim which seems dangerous for the XML parser to get confused, we have to (and prefer to) store the Jenkinsfile(s) in perforce as well. However the documentation on how polling and p4 workspaces work with "Pipeline script from SCM" is lacking or ambiguous and seems to have been tested and documented with declarative pipeline scripts only.

The end result is that in addition to jobs getting built when we do not want them to, our slack channel gets more notifications than it should which is disorienting to the team.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kwirth@perforce.com (JIRA)

unread,
Feb 8, 2019, 5:25:02 AM2/8/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-56037
 
Re: SCM Polling with p4-plugin triggers builds several times

Hi Jeffrey Exterkate. I have sent you a direct email to discuss the topics above. Please let me know here if you don't receive it.

kwirth@perforce.com (JIRA)

unread,
Feb 8, 2019, 5:26:01 AM2/8/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Feb 8, 2019, 5:26:02 AM2/8/19
to jenkinsc...@googlegroups.com

lystor@gmail.com (JIRA)

unread,
Feb 22, 2019, 3:46:01 AM2/22/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi commented on Bug JENKINS-56037
 
Re: SCM Polling with p4-plugin triggers builds several times

We have the same issue.

Jenkins triggers jobs with enabled polling while they are running even without new commits in perforce.

  • Jenkins: 2.150.3 (official docker image)
  • P4 plugin: 1.9.6

dpn982@gmail.com (JIRA)

unread,
Mar 5, 2019, 8:14:01 AM3/5/19
to jenkinsc...@googlegroups.com

Same issue here as well.

Jenkins 2.150.2 (Official Docker Image)

P4 Plugin: 1.9.6

 

Seeing SCM polling trigger jobs with no changes in perforce.

dpn982@gmail.com (JIRA)

unread,
Mar 5, 2019, 8:34:02 AM3/5/19
to jenkinsc...@googlegroups.com
Dave Nichols edited a comment on Bug JENKINS-56037
Same issue here as well.

Jenkins 2.150.2 (Official Docker Image)

P4 Plugin: 1.9.6

 

Seeing SCM polling trigger jobs with no changes in perforce.


Is there any kind of work-around to this issue?

lystor@gmail.com (JIRA)

unread,
Mar 5, 2019, 8:37:02 AM3/5/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Mar 21, 2019, 12:11:02 PM3/21/19
to jenkinsc...@googlegroups.com

Linking this to 'JENKINS-56286' for now. If the fix for that case does not solve it we will look at this one again.

kwirth@perforce.com (JIRA)

unread,
Mar 21, 2019, 12:12:01 PM3/21/19
to jenkinsc...@googlegroups.com

Also linking to this one - JENKINS-56295. Again if that does not solve it either we will come back to this one.

kwirth@perforce.com (JIRA)

unread,
Mar 21, 2019, 12:43:03 PM3/21/19
to jenkinsc...@googlegroups.com

Changed my mind and decided to make this the master job.

Reproduction steps:

(1) Create a pipeline job.
(2) Set it to poll every minute (or use the Poll Now Plugin)
(3) Disable all executors.
(4) Add a changelist that would trigger the job.
(5) Wait 1 minute or click 'Poll Now'.
(6) Wait 1 minute or click 'Poll Now'.
(7) Wait 1 minute or click 'Poll Now'.
(8) Wait 1 minute or click 'Poll Now'.
(9) Enable the executor.
(10) The job will build the same changelist at least 2 times (note there is something else going on that I don't understand where the number of times it builds can be more than 2 times).

At the top of the console log you see 'Started by an SCM change' for each missed poll. For example:

 
Started by an SCM change
Started by an SCM change
...
Started by an SCM change
Started by an SCM change
(25 times)

And the 'build.xml' shows:

          <hudson.triggers.SCMTrigger_-SCMTriggerCause/>
          <int>25</int>

kwirth@perforce.com (JIRA)

unread,
Mar 21, 2019, 12:44:02 PM3/21/19
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Unassigned
 
Change By: Karl Wirth
Assignee: Karl Wirth

kwirth@perforce.com (JIRA)

unread,
Mar 21, 2019, 12:44:02 PM3/21/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Mar 21, 2019, 12:45:03 PM3/21/19
to jenkinsc...@googlegroups.com
Karl Wirth edited a comment on Bug JENKINS-56037
Changed my mind and decided to make this the master job.

Reproduction steps:
{code:java}

(1) Create a pipeline job.
(2) Set it to poll every minute (or use the Poll Now Plugin)
(3) Disable all executors.
(4) Add a changelist that would trigger the job.
(5) Wait 1 minute or click 'Poll Now'.
(6) Wait 1 minute or click 'Poll Now'.
(7) Wait 1 minute or click 'Poll Now'.
(8) Wait 1 minute or click 'Poll Now'.
(9) Enable the executor.
(10) The job will build the same changelist at least 2 times (note there is something else going on that I don't understand where the number of times it builds can be more than 2 times).
{code}


At the top of the console log you see 'Started by an SCM change' for each missed poll. For example:
{code:java}
Started by an SCM change
Started by an SCM change
...
Started by an SCM change
Started by an SCM change
(25 times)
{code}

And the 'build.xml' shows:
{code:java}
          <hudson.triggers.SCMTrigger_-SCMTriggerCause/>
          <int>25</int>
{code}

Passing this occurrence of unexpected retries to development. Note there are other causes I am still investigating.

pallen@perforce.com (JIRA)

unread,
Apr 4, 2019, 6:32:09 AM4/4/19
to jenkinsc...@googlegroups.com

pallen@perforce.com (JIRA)

unread,
Apr 4, 2019, 6:32:10 AM4/4/19
to jenkinsc...@googlegroups.com
Paul Allen started work on Bug JENKINS-56037
 
Change By: Paul Allen
Status: Open In Progress

pallen@perforce.com (JIRA)

unread,
Jun 4, 2019, 9:23:02 AM6/4/19
to jenkinsc...@googlegroups.com

pallen@perforce.com (JIRA)

unread,
Oct 10, 2019, 9:34:06 AM10/10/19
to jenkinsc...@googlegroups.com
Paul Allen commented on Bug JENKINS-56037
 
Re: SCM Polling with p4-plugin triggers builds several times

Karl Wirth - I think this issue is now fixed in release 1.10.5

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

pallen@perforce.com (JIRA)

unread,
Oct 10, 2019, 9:35:03 AM10/10/19
to jenkinsc...@googlegroups.com

pallen@perforce.com (JIRA)

unread,
Oct 15, 2019, 8:49:03 AM10/15/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages