-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins: 2.303.3
OS: Linux - 5.4.196-108.356.amzn2.x86_64
---
ace-editor:1.1
analysis-model-api:10.2.5
ansicolor:1.0.1
ant:475.vf34069fef73c
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
artifactory:3.13.2
authentication-tokens:1.4
authorize-project:1.4.0
aws-credentials:1.29
aws-java-sdk:1.11.995
blueocean:1.24.7
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.24.7
blueocean-commons:1.24.7
blueocean-config:1.24.7
blueocean-core-js:1.24.7
blueocean-dashboard:1.24.7
blueocean-display-url:2.4.1
blueocean-events:1.24.7
blueocean-git-pipeline:1.24.7
blueocean-github-pipeline:1.24.7
blueocean-i18n:1.24.7
blueocean-jwt:1.24.7
blueocean-personalization:1.24.7
blueocean-pipeline-api-impl:1.24.7
blueocean-pipeline-editor:1.24.7
blueocean-pipeline-scm-api:1.24.7
blueocean-rest:1.24.7
blueocean-rest-impl:1.24.7
blueocean-web:1.24.7
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-6
bouncycastle-api:2.25
branch-api:2.7.0
build-monitor-plugin:1.12+build.201809061734
build-timeout:1.20
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:751.vda_24678a_f781
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.708.ve61636eb_65a_5
command-launcher:1.6
conditional-buildstep:1.4.1
config-file-provider:3.9.0
configuration-as-code:1.55
configuration-as-code-groovy:1.1
credentials:2.6.1
credentials-binding:1.27.1
data-tables-api:1.11.4-1
display-url-api:2.3.5
docker-commons:1.18
docker-workflow:1.26
dtkit-api:3.0.0
durable-task:493.v195aefbb0ff2
ec2:1.62
echarts-api:5.3.0-2
email-ext:2.83
envinject:2.4.0
envinject-api:1.8
extended-read-permission:3.2
external-monitor-job:1.7
favorite:2.3.3
filesystem_scm:2.1
font-awesome-api:6.0.0-1
gerrit-code-review:0.4.4
gerrit-trigger:2.36.0
git:4.10.1
git-client:3.11.0
git-server:1.10
github:1.33.1
github-api:1.123
github-branch-source:2.11.1
gradle:1.39.4
greenballs:1.15.1
h2-api:1.4.199
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
http_request:1.9.0
ivy:2.1
jackson2-api:2.13.1-246.va8a9f3eaf46a
jacoco:3.3.0
javadoc:217.v905b_86277a_2a_
javax-activation-api:1.2.0-2
javax-mail-api:1.6.2-5
jaxb:2.3.0
jdk-tool:1.5
jenkins-design-language:1.24.7
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.77
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.54
kubernetes:1.30.1
kubernetes-client-api:5.4.1
kubernetes-credentials:0.9.0
ldap:2.7
lockable-resources:2.14
log-parser:2.1
logfilesizechecker:1.5
mailer:408.vd726a_1130320
mapdb-api:1.0.9.0
mask-passwords:3.0
matrix-auth:3.1
matrix-project:1.20
maven-plugin:3.16
metrics:4.0.2.8.1
momentjs:1.1.1
monitoring:1.88.0
next-build-number:1.6
node-iterator-api:1.5.0
odinPlugin:1.4
okhttp-api:3.14.9
pam-auth:1.6
parameterized-scheduler:1.0
parameterized-trigger:2.42
pipeline-build-step:2.16
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:446.vf27b_0b_83500e
pipeline-maven:3.10.0
pipeline-milestone-step:100.v60a_03cd446e1
pipeline-model-api:1.9.3
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.22
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.22
pipeline-utility-steps:2.11.0
plain-credentials:1.8
plugin-util-api:2.14.0
popper-api:1.16.1-3
popper2-api:2.11.5-1
prometheus:2.0.10
pubsub-light:1.16
rebuild:1.32
resource-disposer:0.17
robot:3.0.1
role-strategy:3.2.0
run-condition:1.5
saml:2.0.9
scm-api:595.vd5a_df5eb_0e39
script-security:1138.v8e727069a_025
sidebar-link:1.12.0
simple-theme-plugin:0.7
slack:2.49
snakeyaml-api:1.29.1
sse-gateway:1.24
ssh-agent:1.24.1
ssh-credentials:1.19
sshd:3.1.0
structs:308.v852b473a2b8c
subversion:2.15.1
swarm:3.30
throttle-concurrents:2.5
timestamper:1.15
token-macro:280.v97a_82642793c
trilead-api:1.0.13
variant:1.4
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:1138.v619fd5201b_2f
workflow-basic-steps:2.24
workflow-cps:2659.v52d3de6044d0
workflow-cps-global-lib:564.ve62a_4eb_b_e039
workflow-durable-task-step:1121.va_65b_d2701486
workflow-job:1145.v7f2433caa07f
workflow-multibranch:711.vdfef37cda_816
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:813.vb_d7c3d2984a_0
ws-cleanup:0.39Jenkins: 2.303.3 OS: Linux - 5.4.196-108.356.amzn2.x86_64 --- ace-editor:1.1 analysis-model-api:10.2.5 ansicolor:1.0.1 ant:475.vf34069fef73c antisamy-markup-formatter:2.1 apache-httpcomponents-client-4-api:4.5.13-1.0 artifactory:3.13.2 authentication-tokens:1.4 authorize-project:1.4.0 aws-credentials:1.29 aws-java-sdk:1.11.995 blueocean:1.24.7 blueocean-autofavorite:1.2.4 blueocean-bitbucket-pipeline:1.24.7 blueocean-commons:1.24.7 blueocean-config:1.24.7 blueocean-core-js:1.24.7 blueocean-dashboard:1.24.7 blueocean-display-url:2.4.1 blueocean-events:1.24.7 blueocean-git-pipeline:1.24.7 blueocean-github-pipeline:1.24.7 blueocean-i18n:1.24.7 blueocean-jwt:1.24.7 blueocean-personalization:1.24.7 blueocean-pipeline-api-impl:1.24.7 blueocean-pipeline-editor:1.24.7 blueocean-pipeline-scm-api:1.24.7 blueocean-rest:1.24.7 blueocean-rest-impl:1.24.7 blueocean-web:1.24.7 bootstrap4-api:4.6.0-3 bootstrap5-api:5.1.3-6 bouncycastle-api:2.25 branch-api:2.7.0 build-monitor-plugin:1.12+build.201809061734 build-timeout:1.20 caffeine-api:2.9.2-29.v717aac953ff3 checks-api:1.7.2 cloudbees-bitbucket-branch-source:751.vda_24678a_f781 cloudbees-disk-usage-simple:0.10 cloudbees-folder:6.708.ve61636eb_65a_5 command-launcher:1.6 conditional-buildstep:1.4.1 config-file-provider:3.9.0 configuration-as-code:1.55 configuration-as-code-groovy:1.1 credentials:2.6.1 credentials-binding:1.27.1 data-tables-api:1.11.4-1 display-url-api:2.3.5 docker-commons:1.18 docker-workflow:1.26 dtkit-api:3.0.0 durable-task:493.v195aefbb0ff2 ec2:1.62 echarts-api:5.3.0-2 email-ext:2.83 envinject:2.4.0 envinject-api:1.8 extended-read-permission:3.2 external-monitor-job:1.7 favorite:2.3.3 filesystem_scm:2.1 font-awesome-api:6.0.0-1 gerrit-code-review:0.4.4 gerrit-trigger:2.36.0 git:4.10.1 git-client:3.11.0 git-server:1.10 github:1.33.1 github-api:1.123 github-branch-source:2.11.1 gradle:1.39.4 greenballs:1.15.1 h2-api:1.4.199 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-1.0 htmlpublisher:1.25 http_request:1.9.0 ivy:2.1 jackson2-api:2.13.1-246.va8a9f3eaf46a jacoco:3.3.0 javadoc:217.v905b_86277a_2a_ javax-activation-api:1.2.0-2 javax-mail-api:1.6.2-5 jaxb:2.3.0 jdk-tool:1.5 jenkins-design-language:1.24.7 jjwt-api:0.11.2-9.c8b45b8bb173 job-dsl:1.77 jquery-detached:1.2.1 jquery3-api:3.6.0-2 jsch:0.1.55.2 junit:1.54 kubernetes:1.30.1 kubernetes-client-api:5.4.1 kubernetes-credentials:0.9.0 ldap:2.7 lockable-resources:2.14 log-parser:2.1 logfilesizechecker:1.5 mailer:408.vd726a_1130320 mapdb-api:1.0.9.0 mask-passwords:3.0 matrix-auth:3.1 matrix-project:1.20 maven-plugin:3.16 metrics:4.0.2.8.1 momentjs:1.1.1 monitoring:1.88.0 next-build-number:1.6 node-iterator-api:1.5.0 odinPlugin:1.4 okhttp-api:3.14.9 pam-auth:1.6 parameterized-scheduler:1.0 parameterized-trigger:2.42 pipeline-build-step:2.16 pipeline-graph-analysis:188.v3a01e7973f2c pipeline-input-step:446.vf27b_0b_83500e pipeline-maven:3.10.0 pipeline-milestone-step:100.v60a_03cd446e1 pipeline-model-api:1.9.3 pipeline-model-definition:1.9.3 pipeline-model-extensions:1.9.3 pipeline-rest-api:2.22 pipeline-stage-step:291.vf0a8a7aeeb50 pipeline-stage-tags-metadata:1.9.3 pipeline-stage-view:2.22 pipeline-utility-steps:2.11.0 plain-credentials:1.8 plugin-util-api:2.14.0 popper-api:1.16.1-3 popper2-api:2.11.5-1 prometheus:2.0.10 pubsub-light:1.16 rebuild:1.32 resource-disposer:0.17 robot:3.0.1 role-strategy:3.2.0 run-condition:1.5 saml:2.0.9 scm-api:595.vd5a_df5eb_0e39 script-security:1138.v8e727069a_025 sidebar-link:1.12.0 simple-theme-plugin:0.7 slack:2.49 snakeyaml-api:1.29.1 sse-gateway:1.24 ssh-agent:1.24.1 ssh-credentials:1.19 sshd:3.1.0 structs:308.v852b473a2b8c subversion:2.15.1 swarm:3.30 throttle-concurrents:2.5 timestamper:1.15 token-macro:280.v97a_82642793c trilead-api:1.0.13 variant:1.4 windows-slaves:1.8 workflow-aggregator:2.6 workflow-api:1138.v619fd5201b_2f workflow-basic-steps:2.24 workflow-cps:2659.v52d3de6044d0 workflow-cps-global-lib:564.ve62a_4eb_b_e039 workflow-durable-task-step:1121.va_65b_d2701486 workflow-job:1145.v7f2433caa07f workflow-multibranch:711.vdfef37cda_816 workflow-scm-step:2.13 workflow-step-api:622.vb_8e7c15b_c95a_ workflow-support:813.vb_d7c3d2984a_0 ws-cleanup:0.39
Prior to the code changes introduced in PR#425, the GerritTrigger.isInteresting() function included the following code to determine if the received change based event was of interest:
if (isServerInteresting(event) && p.isInteresting(changeBasedEvent.getChange().getProject(), changeBasedEvent.getChange().getBranch(), changeBasedEvent.getChange().getTopic())) { boolean containsFilePathsOrForbiddenFilePaths = ((p.getFilePaths() != null && p.getFilePaths().size() > 0) || (p.getForbiddenFilePaths() != null && p.getForbiddenFilePaths().size() > 0)); if (isFileTriggerEnabled() && containsFilePathsOrForbiddenFilePaths) { if (isServerInteresting(event) && p.isInteresting(changeBasedEvent.getChange().getProject(), changeBasedEvent.getChange().getBranch(), changeBasedEvent.getChange().getTopic(), changeBasedEvent.getFiles( new GerritQueryHandler(getServerConfig(event))))) { logger.trace("According to {} the event is interesting; event: {}", p, event); return true; } } else { logger.trace("According to {} the event is interesting; event: {}", p, event); return true; } }
The important thing here is that the outer if block checks if the project, branch and topic match before the inner block gets the list of files for the change event. To do the later it has to query the Gerrit server since the information isn't present in the change event (hence the need to pass a GerritQueryHandler instance).
However, after the changes were made (released in gerrit-trigger-2.33.0) the code was split out into a separate function, but the if blocks were also un-nested.
if (isFileTriggerEnabled() && containsFilePathsOrForbiddenFilePaths) { if (project.isInteresting(change.getProject(), change.getBranch(), change.getTopic(), change.getFiles(gerritQueryHandler))) { shouldTrigger = true; } } else { if (project.isInteresting(change.getProject(), change.getBranch(), change.getTopic())) { shouldTrigger = true; } }
The effect of this is that the list of files is fetched before any test of the project, branch and topic. So for every job triggered by Gerrit change events, if there are any file path filters defined then Jenkins will always query Gerrit to get the list of file paths even if ultimately the event will be discarded.
In a large Gerrit/Jenkins environment, this very quickly results in a large number of unnecessary requests. Also, since GerritTrigger.isInteresting() is called from GerritTrigger.gerritEvent(), the incoming event queue worker pool threads end up blocked waiting on the file path queries to Gerrit, which in turn causes a backlog in the incoming event handler queue to build up that is also visible in the logs. For example:
The Gerrit incoming events queue contains 12279 items! Something might be stuck, or your system can't process the commands fast enough.
- duplicates
-
JENKINS-70234 gerrit-trigger plugin sends floods of queries to gerrit
- Closed