jenkinsci / jenkinsci/git-plugin

[JENKINS-64371] Git branch source provider adds long delays with many branches

Open
#3,621 0 comments 0 reactions 0 assignees View on GitHub
component:git-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

The git branch source provider inserts a 15 second delay when running a job in a multibranch project in some cases and then inserts another delay of 15 seconds before starting the actual work of running the job.

The GitHub branch source provider does not insert those delays. Users should use the higher level branch source providers (GitHub, Bitbucket, GitLab, Gitea) rather than the branch source provider from the git plugin.

Issue is visible in my jenkins-bugs repository (currently with 170 branches).

Git branch source time stamps

Notice the elapsed time gap between "Branch indexing" and the next statement, then the elapsed time gap between "Seen 170 remote branches" and the next statement.

```
00:00:00.001 Branch indexing
00:00:16.322 > git rev-parse --is-inside-work-tree # timeout=11
00:00:16.326 Setting origin to https://github.com/MarkEWaite/jenkins-bugs.git
00:00:16.326 > git config remote.origin.url https://github.com/MarkEWaite/jenkins-bugs.git # timeout=11
00:00:16.329 Fetching origin...
00:00:16.330 Fetching upstream changes from origin
00:00:16.330 > git --version # timeout=11
00:00:16.333 > git --version # 'git version 2.11.0'
00:00:16.333 > git config --get remote.origin.url # timeout=11
00:00:16.337 using GIT_ASKPASS to set credentials MarkEWaite github username/password
00:00:16.337 > git fetch --tags --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=11
00:00:16.932 Seen 170 remote branches
00:00:31.153 Obtained Jenkinsfile from ccab97146f34497e359bfa594aaefb634f986ae9
00:00:31.153 Running in Durability level: PERFORMANCE_OPTIMIZED

```

GitHub branch source time stamps

Notice here that the time gap between started and "Running in Durability level" is less than 1 second instead of over 30 seconds.

```
00:00:00.000 Started by user Mark Waite
00:00:00.093 08:48:10 Connecting to https://api.github.com using MarkEWaite/****** (MarkEWaite github username/password)
00:00:00.650 Obtained Jenkinsfile from d9a27419cf7a554423f5039afdd5b32c95d59c5e
00:00:00.651 Running in Durability level: PERFORMANCE_OPTIMIZED

```

---
Originally reported by markewaite, imported from: Git branch source provider adds long delays with many branches


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

The git branch source provider inserts a 15 second delay when running a job in a multibranch project in some cases and then inserts another delay of 15 seconds before starting the actual work of running the job.

The GitHub branch source provider does not insert those delays. Users should use the higher level branch source providers (GitHub, Bitbucket, GitLab, Gitea) rather than the branch source provider from the git plugin.

Issue is visible in my jenkins-bugs repository (currently with 170 branches).

Git branch source time stamps

Notice the elapsed time gap between "Branch indexing" and the next statement, then the elapsed time gap between "Seen 170 remote branches" and the next statement.


00:00:00.001  Branch indexing

00:00:16.322 > git rev-parse --is-inside-work-tree # timeout=11
00:00:16.326 Setting origin to https://github.com/MarkEWaite/jenkins-bugs.git
00:00:16.326 > git config remote.origin.url https://github.com/MarkEWaite/jenkins-bugs.git # timeout=11
00:00:16.329 Fetching origin...
00:00:16.330 Fetching upstream changes from origin
00:00:16.330 > git --version # timeout=11
00:00:16.333 > git --version # 'git version 2.11.0'
00:00:16.333 > git config --get remote.origin.url # timeout=11
00:00:16.337 using GIT_ASKPASS to set credentials MarkEWaite github username/password
00:00:16.337 > git fetch --tags --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=11
00:00:16.932 Seen 170 remote branches
00:00:31.153 Obtained Jenkinsfile from ccab97146f34497e359bfa594aaefb634f986ae9
00:00:31.153 Running in Durability level: PERFORMANCE_OPTIMIZED

GitHub branch source time stamps

Notice here that the time gap between started and "Running in Durability level" is less than 1 second instead of over 30 seconds.


00:00:00.000  Started by user Mark Waite

00:00:00.093 08:48:10 Connecting to https://api.github.com using MarkEWaite/****** (MarkEWaite github username/password)
00:00:00.650 Obtained Jenkinsfile from d9a27419cf7a554423f5039afdd5b32c95d59c5e
00:00:00.651 Running in Durability level: PERFORMANCE_OPTIMIZED

environment

```
Jenkins 2.263.1

Plugins as stored in the lts-with-plugins branch of my docker-lfs repo
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.