I have multi-branch pipelines defined for a number of my github enterprise repositories. One repo in particular has frequent long (sometimes very long) delays starting up, just looking for the Jenkinsfile to execute. This repo is definitely our largest in terms of commits/tags/branches/etc.
The output from the job shows:
Setting origin to git@<github server>:<org>/<repo>
> git config remote.origin.url git@<github server>:<org>/<repo> # timeout=10
Fetching origin...
Fetching upstream changes from origin
> git --version # timeout=10
> git --version # 'git version 2.20.1'
> git config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials
> git fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
Seen branch in repository origin/1.15.1
Seen branch in repository origin/10032/dispatcher-retries
... <lots of additional Seen branch ... lines>
Seen 2,305 remote branches
Obtained Jenkinsfile from 062d9c90fd3e95e7682a7440a46a2ec45999b6ad
Running in Durability level: MAX_SURVIVABILITY
...
Where I am seeing the big delay is between the lines Seen 2,305 remote branches and Obtained Jenkinsfile from 062d9c90fd3e95e7682a7440a46a2ec45999b6ad. My question is, what is the Jenkins plugin doing at that point? If I knew what it was doing, I could potentially cleanup the repo to speed the process up.
I have tried playing around with some of the advanced settings, like shallow clone and skip fetching tags, but those changes don't seem to cause any differences until after the delay, when it actually starts the clone operation.