github-plugin icon indicating copy to clipboard operation
github-plugin copied to clipboard

[JENKINS-56318] GitHub initial push triggers 2 builds from Multibranch pipeline

Open jenkins-infra-bot opened this issue 6 years ago • 2 comments

we have a pipeline setup to build all branches. on an initial push of a branch two builds are kicked off for the branch that is pushed at the same time.  

 

at 12:57 i pushed here's the output from the push log in jenkins

 

[Tue Feb 26 11:26:11 MST 2019] Push event to branch master in repository commerce/catalog UPDATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Tue Feb 26 11:26:05 MST 2019 processed in 0.47 sec
[Wed Feb 27 12:57:21 MST 2019] Received Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019
12:57:21 Connecting to http://github.body.prod/api/v3 using Jenkins_Github/****** (Github collaborator account for Jenkins)
Examining commerce/catalog

  Checking branches...

  Getting remote branch BBECOM-18919-Shipping-79...

[Wed Feb 27 12:57:21 MST 2019] Received Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019
12:57:21 Connecting to http://github.body.prod/api/v3 using Jenkins_Github/****** (Github collaborator account for Jenkins)
Examining commerce/catalog

  Checking branches...

  Getting remote branch BBECOM-18919-Shipping-79...

    Checking branch BBECOM-18919-Shipping-79
      ‘Jenkinsfile’ found
    Met criteria
    Checking branch BBECOM-18919-Shipping-79
      ‘Jenkinsfile’ found
    Met criteria
Scheduled build for branch: BBECOM-18919-Shipping-79

  1 branches were processed (query completed)

  1 branches were processed

Finished examining commerce/catalog

[Wed Feb 27 12:57:23 MST 2019] Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019 processed in 2.4 sec
Changes detected: BBECOM-18919-Shipping-79 (null → f5190721fcc185d03a1eb7f6e83729a5d4b10135)
Scheduled build for branch: BBECOM-18919-Shipping-79

  1 branches were processed (query completed)

  1 branches were processed

Finished examining commerce/catalog

[Wed Feb 27 12:57:24 MST 2019] Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019 processed in 2.5 sec
[Wed Feb 27 13:02:18 MST 2019] Received Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog UPDATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 13:02:13 MST 2019
13:02:18 Connecting to http://github.body.prod/api/v3 using Jenkins_Github/****** (Github collaborator account for Jenkins)
Examining commerce/catalog

 

two pushes are delivered at the same time and thus two builds are run.  The two pushes seem to be 1 from a repo hook and 1 from the org hook.

 

The repo shows the push

see the webhook to our ci-m1.body.prod server.

 

at the org level we have another hook

 

it pushed at 12:57 as well

 

 

i'm thinking the two pushes race with each other.  the problem is AFAIK it was the github-plugin that setup the two hooks to begin with!  so it's causing it's own problems...

 

wondering if maybe i just have a misconfiguration...but i don't think so.


Originally reported by drdamour, imported from: GitHub initial push triggers 2 builds from Multibranch pipeline
  • assignee: lanwen
  • status: Open
  • priority: Minor
  • component(s): github-plugin
  • label(s): github-plugin, jenkins, multi-branch, pipeline, plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-08
Raw content of original issue

we have a pipeline setup to build all branches. on an initial push of a branch two builds are kicked off for the branch that is pushed at the same time.  

 

at 12:57 i pushed here's the output from the push log in jenkins

 

[Tue Feb 26 11:26:11 MST 2019] Push event to branch master in repository commerce/catalog UPDATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Tue Feb 26 11:26:05 MST 2019 processed in 0.47 sec
[Wed Feb 27 12:57:21 MST 2019] Received Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019
12:57:21 Connecting to http://github.body.prod/api/v3 using Jenkins_Github/****** (Github collaborator account for Jenkins)
Examining commerce/catalog

  Checking branches...

  Getting remote branch BBECOM-18919-Shipping-79...

[Wed Feb 27 12:57:21 MST 2019] Received Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019
12:57:21 Connecting to http://github.body.prod/api/v3 using Jenkins_Github/****** (Github collaborator account for Jenkins)
Examining commerce/catalog

  Checking branches...

  Getting remote branch BBECOM-18919-Shipping-79...

    Checking branch BBECOM-18919-Shipping-79
      ‘Jenkinsfile’ found
    Met criteria
    Checking branch BBECOM-18919-Shipping-79
      ‘Jenkinsfile’ found
    Met criteria
Scheduled build for branch: BBECOM-18919-Shipping-79

  1 branches were processed (query completed)

  1 branches were processed

Finished examining commerce/catalog

[Wed Feb 27 12:57:23 MST 2019] Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019 processed in 2.4 sec
Changes detected: BBECOM-18919-Shipping-79 (null → f5190721fcc185d03a1eb7f6e83729a5d4b10135)
Scheduled build for branch: BBECOM-18919-Shipping-79

  1 branches were processed (query completed)

  1 branches were processed

Finished examining commerce/catalog

[Wed Feb 27 12:57:24 MST 2019] Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog CREATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 12:57:16 MST 2019 processed in 2.5 sec
[Wed Feb 27 13:02:18 MST 2019] Received Push event to branch BBECOM-18919-Shipping-79 in repository commerce/catalog UPDATED event from 10.0.17.214 ⇒ http://ci-m1.body.prod:8080/github-webhook/ with timestamp Wed Feb 27 13:02:13 MST 2019
13:02:18 Connecting to http://github.body.prod/api/v3 using Jenkins_Github/****** (Github collaborator account for Jenkins)
Examining commerce/catalog

 

two pushes are delivered at the same time and thus two builds are run.  The two pushes seem to be 1 from a repo hook and 1 from the org hook.

 

The repo shows the push

see the webhook to our ci-m1.body.prod server.

 

at the org level we have another hook

 

it pushed at 12:57 as well

 

 

i'm thinking the two pushes race with each other.  the problem is AFAIK it was the github-plugin that setup the two hooks to begin with!  so it's causing it's own problems...

 

wondering if maybe i just have a misconfiguration...but i don't think so.

environment
Jenkins ver. 2.150.1<br/>
github plugin 1.29.0<br/>
github enterprise 2.15
4 attachments

jenkins-infra-bot avatar Feb 27 '19 23:02 jenkins-infra-bot

drdamour:
  • Original comment link
  • Raw content of original comment:

    also it'd be REALLY nice if that log included the X-GitHub-Delivery request header to help trace issues back to github.

also it'd be REALLY nice if that log included the X-GitHub-Delivery request header to help trace issues back to github.

jenkins-infra-bot avatar Feb 27 '19 23:02 jenkins-infra-bot

drdamour:

possible workaround is to use throttling from JENKINS-38552">JENKINS-38552

jenkins-infra-bot avatar Apr 11 '19 11:04 jenkins-infra-bot