-
Bug
-
Resolution: Unresolved
-
Major
-
None
When accessing any page featuring a build with promotions (eg. job page, but also job list where promotion icon column is enabled), we are experiencing extremely poor performance.
I had a look at the stack while this was going on and it seems to be because of something related to having a build parameter tied to Git branches:
Handling GET /job/MyJob/ from 127.0.0.1 : qtp19448387-247861 Job/index.jelly AbstractProject/sidepanel.jelly HistoryWidget/index.jelly HistoryPageFilter/entries.jelly HistoryPageFilter/entries.jelly HistoryPageFilter/entry.jelly PromotedBuildAction/badge.jelly java.lang.ProcessImpl.waitForInterruptibly(Native Method) java.lang.ProcessImpl.waitFor(Unknown Source) hudson.Proc$LocalProc.join(Proc.java:324) hudson.Proc.joinWithTimeout(Proc.java:170) org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2012) org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735) org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1640) org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1631) org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:2851) net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.getBranch(GitParameterDefinition.java:392) net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.generateContents(GitParameterDefinition.java:315) net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl.doFillValueItems(GitParameterDefinition.java:633) net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition.getDefaultParameterValue(GitParameterDefinition.java:163) hudson.plugins.promoted_builds.PromotionProcess.getDefaultParameterValuesAsEnvVars(PromotionProcess.java:300) hudson.plugins.promoted_builds.PromotionProcess.isVisible(PromotionProcess.java:281)
Pages will take upwards of minutes to finish loading. Turning off promoted builds or Git branch parameter for a job will restore performance back to typical load times.
Please let me know if there is anything you need me to try out.
Maybe the Promoted Builds Plugin should cache the result of PromotionProcess#isVisible in the isVisible field so that the git parameter plugin doesn't have to make so many remote calls or make the feature added in https://github.com/jenkinsci/promoted-builds-plugin/pull/76 able to be disabled so these calls aren't made in the first place, but I'm not really familiar with how the feature is supposed to work in the first place.
I'm not sure if the git parameter plugin could do anything to optimize getting the default parameter value CC klimas7.
I do not expect to have time to work on this myself, but I am happy to help review any PRs that you submit. Here is the code that I would investigate: https://github.com/jenkinsci/promoted-builds-plugin/blob/e4c9304553f2868f67556644f5831eba60cf2c34/src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java#L273.