Skip to content

Push event to branch not delivered to projectwhen concurrent webhook events arrive #1537

Description

@zyberon

Jenkins and plugins versions report

Summary

When two webhook events for the same repository arrive within ~2 seconds of each other (e.g., a push to master from a squash merge + an automatic branch deletion), the global DefaultPushGHEventSubscriber processes both events and reports matches, but one of the events is never delivered to the project-specific MultiBranchProject handler. The affected branch build is silently skipped — no build is triggered, no log entry appears in the project's indexing/events.log, and the only way to recover is a manual re-scan or a new push.

Environment

Environment
Jenkins: 2.504.3
github-branch-source: 1917.v9ee8a_39b_3d0d
github-plugin: 1.45.0
github-api: 1.330-492.v3941a_032db_2a_
Java: 17
OS: Ubuntu 22.04 (207 days uptime, no restart during incident)

Evidence

MultiBranchProject.log (global branch source handler) — both processed, interleaved:

[Mon Jul 13 10:17:26 CEST 2026] Received Push event to branch master in repository bt-advanced-analytics/mng-terraform UPDATED event
Found match against General/Terraform/mng-terraform-drift-dev
[Mon Jul 13 10:17:28 CEST 2026] Received Push event to branch feature/fix_perso_ai_hub in repository bt-advanced-analytics/mng-terraform REMOVED event
Found match against General/Terraform/mng-terraform
[Mon Jul 13 10:17:29 CEST 2026] Finished processing Push event to branch feature/fix_perso_ai_hub ... processed in 804ms. Matched 1.
Found match against General/Terraform/mng-terraform-drift-pre
Found match against General/Terraform/mng-terraform-drift-pro
Found match against General/Terraform/mng-terraform
[Mon Jul 13 10:17:38 CEST 2026] Finished processing Push event to branch master ... processed in 11697ms. Matched 5.
Note: the two events are processed concurrently (interleaved "Found match" lines). The delete event finishes first (804ms), the push to master finishes later (11697ms).
jobs/General/jobs/Terraform/jobs/mng-terraform/indexing/events.log (project-specific handler):
(no entry at 10:17 CEST — the next entry is at 10:51 CEST, 34 minutes later)
The push to master was never delivered to this project handler despite "Matched 5" in the global log.

Comparison: push event without concurrency (works correctly)
39 minutes later, another push to master arrives with no concurrent events:

[Mon Jul 13 10:56:42 CEST 2026] Received Push event to branch master ... UPDATED event
[Mon Jul 13 10:56:43 CEST 2026] Push event to branch master ... processed in 1.3 sec
This event is delivered to the project handler and triggers build #2313 successfully.

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins: 2.504.3
github-branch-source: 1917.v9ee8a_39b_3d0d
github-plugin: 1.45.0
github-api: 1.330-492.v3941a_032db_2a_
Java: 17
OS: Ubuntu 22.04 (207 days uptime, no restart during incident)

Reproduction steps

1- Configure a Multibranch Pipeline (GitHub Branch Source) for a repository with "Automatically delete head branches" enabled in GitHub.
2- Open a PR and squash-merge it to master.
3-GitHub sends two webhook events nearly simultaneously:
-push to refs/heads/master (the squash merge commit)
-delete of refs/heads/feature/xyz (automatic branch cleanup)
4-Both events arrive within ~2 seconds.

Expected Results

Both events are processed and delivered to the matching MultiBranchProject handlers. A build is triggered for the master branch.

Actual Results

The global handler receives and processes both events (jenkins.log shows "Matched 5" for the push to master), but the project-specific handler (jobs/.../mng-terraform/indexing/events.log) has no entry for the push to master. No build is triggered. The delete event is processed normally.

Anything else?

No response

Are you interested in contributing a fix?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions