-
Bug
-
Resolution: Fixed
-
Critical
-
Jenkins: 2.372 in a container
OS: Linux - 4.14.291-218.527.amzn2.x86_64
openjdk 11.0.16.1 2022-08-12
OpenJDK Runtime Environment Temurin-11.0.16.1+1 (build 11.0.16.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.16.1+1 (build 11.0.16.1+1, mixed mode)
---
Parameterized-Remote-Trigger:3.1.6.3
PrioritySorter:4.1.0
ace-editor:1.1
allure-jenkins-plugin:2.30.2
analysis-core:1.96
analysis-model-api:10.17.0
ansicolor:1.0.2
ant:475.vf34069fef73c
antisamy-markup-formatter:2.7
apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61
authentication-tokens:1.3
aws-credentials:1.32
aws-java-sdk:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-cloudformation:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-codebuild:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-ec2:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-ecr:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-ecs:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-efs:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-elasticbeanstalk:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-iam:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-logs:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-minimal:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-sns:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-sqs:1.12.287-357.vf82d85a_6eefd
aws-java-sdk-ssm:1.12.287-357.vf82d85a_6eefd
azure-ad:154.v12e17a5f9ea3
basic-branch-build-strategies:1.3.2
bootstrap5-api:5.2.1-2
bouncycastle-api:2.26
branch-api:2.1046.v0ca_37783ecc5
browserstack-integration:1.2.4
build-failure-analyzer:2.4.0
build-timeout:1.24
build-user-vars-plugin:1.9
built-on-column:1.1
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
cctray-xml:38.v5753082573e5
checks-api:1.7.5
cloudbees-folder:6.770.ve57b_a_fb_6a_67c
cobertura:1.17
code-coverage-api:3.2.0
command-launcher:1.2
conditional-buildstep:1.4.2
config-file-provider:3.11.1
configurationslicing:430.v966357576543
copyartifact:1.47
credentials:1139.veb_9579fca_33b_
credentials-binding:523.vd859a_4b_122e6
dark-theme:245.vb_a_2b_b_010ea_96
dashboard-view:2.447.vda_124dd35f11
data-tables-api:1.12.1-3
discard-old-build:1.05
disk-usage:0.28
display-url-api:2.3.6
docker-build-publish:1.4.0
docker-commons:1.19
docker-workflow:521.v1a_a_dd2073b_2e
dtkit-api:3.0.2
durable-task:501.ve5d4fc08b0be
ec2-fleet:2.5.1
echarts-api:5.4.0-1
email-ext:2.91
envinject:2.881.v37c62073ff97
envinject-api:1.199.v3ce31253ed13
extended-choice-parameter:346.vd87693c5a_86c
file-leak-detector:1.10
font-awesome-api:6.2.0-3
forensics-api:1.15.1
git:4.12.1
git-client:3.11.0
git-server:1.10
github:1.35.0
github-api:1.303-400.v35c2d8258028
github-branch-source:1695.v88de84e9f6b_9
github-checks:1.0.19
github-oauth:0.39
h2-api:1.4.199
hashicorp-vault-plugin:356.ved18810a_b_828
htmlpublisher:1.31
http_request:1.16
influxdb:3.3
instance-identity:116.vf8f487400980
ionicons-api:28.va_f3a_84439e5f
jackson2-api:2.13.3-285.vc03c0256d517
jakarta-activation-api:2.0.0-3
jakarta-mail-api:2.0.0-6
javadoc:217.v905b_86277a_2a_
javax-activation-api:1.2.0-4
javax-mail-api:1.6.2-5
jaxb:2.3.6-2
jdk-tool:1.0
jenkins-multijob-plugin:623.v03401733c9a_9
jira-ext:0.9
jira-steps:2.0.141.vd0c6e6dc83f0
jive-jenkins:2.5.3
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.15-1
jquery:1.12.4-0
jquery3-api:3.6.0-4
jsch:0.1.55.2
junit:1150.v5c2848328b_60
leastload:3.0.0
lockable-resources:2.18
m2release:0.16.3
mail-watcher-plugin:1.17
mailer:435.v79ef3972b_5c7
managed-scripts:1.5.4
mask-passwords:3.3
matrix-auth:3.1
matrix-project:772.v494f19991984
maven-plugin:3.19
maven-repo-cleaner:1.2
metrics:4.2.10-389.v93143621b_050
momentjs:1.1.1
msbuild:1.30
nexus-artifact-uploader:2.13
nexus-jenkins-plugin:3.16.449.v50228c7ca_222
okhttp-api:4.9.3-108.v0feda04578cf
pagerduty:0.7.0
parameterized-trigger:2.39
pipeline-aws:1.43
pipeline-build-step:2.18
pipeline-githubnotify-step:49.vf37bf92d2bc8
pipeline-graph-analysis:1.11
pipeline-groovy-lib:593.va_a_fc25d520e9
pipeline-input-step:451.vf1a_a_4f405289
pipeline-maven:1205.vceea_7b_972817
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2114.v2654ca_721309
pipeline-model-definition:2.2114.v2654ca_721309
pipeline-model-extensions:2.2114.v2654ca_721309
pipeline-npm:0.9.2
pipeline-rest-api:2.26
pipeline-stage-step:296.v5f6908f017a_5
pipeline-stage-tags-metadata:2.2114.v2654ca_721309
pipeline-stage-view:2.26
pipeline-utility-steps:2.13.0
plain-credentials:1.8
plugin-util-api:2.17.0
popper2-api:2.11.5-2
prism-api:1.29.0-1
prisma-cloud-jenkins-plugin:22.01.840
rebuild:1.34
release:2.14
robot:3.3.0
run-condition:1.5
scm-api:621.vda_a_b_055e58f7
script-security:1175.v4b_d517d6db_f0
scriptler:3.5
slack:616.v03b_1e98d13dd
slave-setup:1.10
snakeyaml-api:1.32-86.ve3f030a_75631
ssh-agent:295.v9ca_a_1c7cc3a_a_
ssh-credentials:295.vced876c18eb_4
ssh-slaves:2.846.v1b_70190624f5
sshd:3.236.ved5e1b_cb_50b_2
structs:324.va_f5d6774f3a_d
test-results-analyzer:0.3.5
test-stability:2.3
theme-manager:1.5
thinBackup:1.10
timestamper:1.20
token-macro:308.v4f2b_ed62b_b_16
trilead-api:1.67.vc3938a_35172f
variant:1.4
view-job-filters:2.3
warnings-ng:9.20.1
windows-slaves:1.8.1
workflow-api:1198.v4596ea_5329b_6
workflow-basic-steps:986.v6b_9c830a_6b_37
workflow-cps:2802.v5ea_628154b_c2
workflow-cps-global-lib:588.v576c103a_ff86
workflow-durable-task-step:1199.v02b_9244f8064
workflow-job:1232.v5a_4c994312f1
workflow-multibranch:716.vc692a_e52371b_
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:838.va_3a_087b_4055b
xunit:3.1.1Jenkins: 2.372 in a container OS: Linux - 4.14.291-218.527.amzn2.x86_64 openjdk 11.0.16.1 2022-08-12 OpenJDK Runtime Environment Temurin-11.0.16.1+1 (build 11.0.16.1+1) OpenJDK 64-Bit Server VM Temurin-11.0.16.1+1 (build 11.0.16.1+1, mixed mode) --- Parameterized-Remote-Trigger:3.1.6.3 PrioritySorter:4.1.0 ace-editor:1.1 allure-jenkins-plugin:2.30.2 analysis-core:1.96 analysis-model-api:10.17.0 ansicolor:1.0.2 ant:475.vf34069fef73c antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61 authentication-tokens:1.3 aws-credentials:1.32 aws-java-sdk:1.12.287-357.vf82d85a_6eefd aws-java-sdk-cloudformation:1.12.287-357.vf82d85a_6eefd aws-java-sdk-codebuild:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ec2:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ecr:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ecs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-efs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-elasticbeanstalk:1.12.287-357.vf82d85a_6eefd aws-java-sdk-iam:1.12.287-357.vf82d85a_6eefd aws-java-sdk-logs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-minimal:1.12.287-357.vf82d85a_6eefd aws-java-sdk-sns:1.12.287-357.vf82d85a_6eefd aws-java-sdk-sqs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ssm:1.12.287-357.vf82d85a_6eefd azure-ad:154.v12e17a5f9ea3 basic-branch-build-strategies:1.3.2 bootstrap5-api:5.2.1-2 bouncycastle-api:2.26 branch-api:2.1046.v0ca_37783ecc5 browserstack-integration:1.2.4 build-failure-analyzer:2.4.0 build-timeout:1.24 build-user-vars-plugin:1.9 built-on-column:1.1 caffeine-api:2.9.3-65.v6a_47d0f4d1fe cctray-xml:38.v5753082573e5 checks-api:1.7.5 cloudbees-folder:6.770.ve57b_a_fb_6a_67c cobertura:1.17 code-coverage-api:3.2.0 command-launcher:1.2 conditional-buildstep:1.4.2 config-file-provider:3.11.1 configurationslicing:430.v966357576543 copyartifact:1.47 credentials:1139.veb_9579fca_33b_ credentials-binding:523.vd859a_4b_122e6 dark-theme:245.vb_a_2b_b_010ea_96 dashboard-view:2.447.vda_124dd35f11 data-tables-api:1.12.1-3 discard-old-build:1.05 disk-usage:0.28 display-url-api:2.3.6 docker-build-publish:1.4.0 docker-commons:1.19 docker-workflow:521.v1a_a_dd2073b_2e dtkit-api:3.0.2 durable-task:501.ve5d4fc08b0be ec2-fleet:2.5.1 echarts-api:5.4.0-1 email-ext:2.91 envinject:2.881.v37c62073ff97 envinject-api:1.199.v3ce31253ed13 extended-choice-parameter:346.vd87693c5a_86c file-leak-detector:1.10 font-awesome-api:6.2.0-3 forensics-api:1.15.1 git:4.12.1 git-client:3.11.0 git-server:1.10 github:1.35.0 github-api:1.303-400.v35c2d8258028 github-branch-source:1695.v88de84e9f6b_9 github-checks:1.0.19 github-oauth:0.39 h2-api:1.4.199 hashicorp-vault-plugin:356.ved18810a_b_828 htmlpublisher:1.31 http_request:1.16 influxdb:3.3 instance-identity:116.vf8f487400980 ionicons-api:28.va_f3a_84439e5f jackson2-api:2.13.3-285.vc03c0256d517 jakarta-activation-api:2.0.0-3 jakarta-mail-api:2.0.0-6 javadoc:217.v905b_86277a_2a_ javax-activation-api:1.2.0-4 javax-mail-api:1.6.2-5 jaxb:2.3.6-2 jdk-tool:1.0 jenkins-multijob-plugin:623.v03401733c9a_9 jira-ext:0.9 jira-steps:2.0.141.vd0c6e6dc83f0 jive-jenkins:2.5.3 jjwt-api:0.11.5-77.v646c772fddb_0 jnr-posix-api:3.1.15-1 jquery:1.12.4-0 jquery3-api:3.6.0-4 jsch:0.1.55.2 junit:1150.v5c2848328b_60 leastload:3.0.0 lockable-resources:2.18 m2release:0.16.3 mail-watcher-plugin:1.17 mailer:435.v79ef3972b_5c7 managed-scripts:1.5.4 mask-passwords:3.3 matrix-auth:3.1 matrix-project:772.v494f19991984 maven-plugin:3.19 maven-repo-cleaner:1.2 metrics:4.2.10-389.v93143621b_050 momentjs:1.1.1 msbuild:1.30 nexus-artifact-uploader:2.13 nexus-jenkins-plugin:3.16.449.v50228c7ca_222 okhttp-api:4.9.3-108.v0feda04578cf pagerduty:0.7.0 parameterized-trigger:2.39 pipeline-aws:1.43 pipeline-build-step:2.18 pipeline-githubnotify-step:49.vf37bf92d2bc8 pipeline-graph-analysis:1.11 pipeline-groovy-lib:593.va_a_fc25d520e9 pipeline-input-step:451.vf1a_a_4f405289 pipeline-maven:1205.vceea_7b_972817 pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:2.2114.v2654ca_721309 pipeline-model-definition:2.2114.v2654ca_721309 pipeline-model-extensions:2.2114.v2654ca_721309 pipeline-npm:0.9.2 pipeline-rest-api:2.26 pipeline-stage-step:296.v5f6908f017a_5 pipeline-stage-tags-metadata:2.2114.v2654ca_721309 pipeline-stage-view:2.26 pipeline-utility-steps:2.13.0 plain-credentials:1.8 plugin-util-api:2.17.0 popper2-api:2.11.5-2 prism-api:1.29.0-1 prisma-cloud-jenkins-plugin:22.01.840 rebuild:1.34 release:2.14 robot:3.3.0 run-condition:1.5 scm-api:621.vda_a_b_055e58f7 script-security:1175.v4b_d517d6db_f0 scriptler:3.5 slack:616.v03b_1e98d13dd slave-setup:1.10 snakeyaml-api:1.32-86.ve3f030a_75631 ssh-agent:295.v9ca_a_1c7cc3a_a_ ssh-credentials:295.vced876c18eb_4 ssh-slaves:2.846.v1b_70190624f5 sshd:3.236.ved5e1b_cb_50b_2 structs:324.va_f5d6774f3a_d test-results-analyzer:0.3.5 test-stability:2.3 theme-manager:1.5 thinBackup:1.10 timestamper:1.20 token-macro:308.v4f2b_ed62b_b_16 trilead-api:1.67.vc3938a_35172f variant:1.4 view-job-filters:2.3 warnings-ng:9.20.1 windows-slaves:1.8.1 workflow-api:1198.v4596ea_5329b_6 workflow-basic-steps:986.v6b_9c830a_6b_37 workflow-cps:2802.v5ea_628154b_c2 workflow-cps-global-lib:588.v576c103a_ff86 workflow-durable-task-step:1199.v02b_9244f8064 workflow-job:1232.v5a_4c994312f1 workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:639.v6eca_cd8c04a_a_ workflow-support:838.va_3a_087b_4055b xunit:3.1.1
-
-
2.375, 2.361.4
Issue
After upgrading from 2.340(jdk8 image) to 2.372(jdk11 image), just after stargin Jenkins, the Queue maintain gets into an infinite recursive loop and throws a stackoverflow, rendering the Queue unusable (jobs can't run).
Same scenario occurred twice in prod. Everything was fine during tests but obviously without the same jobs in the Queue.
Hypothesis on the cause
This looks like very much an edge-case not caught by the tests and validations of this change, JENKINS-68780 - https://github.com/jenkinsci/jenkins/pull/6675, which was introduced in 2.361
We do have the priority-sorter-plugin that could be interfering with the Queue, but I verified and the Blocking Items are all traversed anyway in AbstractProject
Technical explanation
Prerequisites
- Job has blockBuildWhenDownstreamBuilding or blockBuildWhenUpstreamBuilding enabled
- Job is blocked without an assigned BlockedItem.causeOfBlockage (null)
I cannot yet explain how the BlockedItem.causeOfBlockage was null. I'm still investigation on that.
** - However, it's clearly supported as I could see that null BlockedItem.causeOfBlockage is supported in the code but causes the infinite loop since the mentioned modification
- UPDATE 2022-10-17: It doesn't change the fact that null causeOfBlockage is supported, but here are where it could emanate from:
- Restored from the Queue.xml at startup
- Instantiated indirectly
- A plugin
- Another mechanism?
- UPDATE 2022-10-17: It doesn't change the fact that null causeOfBlockage is supported, but here are where it could emanate from:
Issue comes from the fact that BlockedItem.causeOfBlockage can be null. This has been validated with a heap dump
Cleaned up Call chain leading to the issue (reconstituted)
There must be a null BlockedItem.causeOfBlockage
// Read from bottom to top like a stacktrace -- Again, and so on hudson.model.Qeueue$BlockedItem.getCauseOfBlockage(Queue.java:2630) [This is where the null causeOfBlockage is important] hudson.model.AbstractProject.getBuildingUpstream(AbtractProject.java:1143) hudson.model.AbstractProject.getCauseOfBlockage(AbtractProject.java:1094) hudson.model.Queue.getCauseOfBlockageForTask(Queue.java:1240) hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1197) -- Another recursion of the loop hudson.model.Qeueue$BlockedItem.getCauseOfBlockage(Queue.java:2630) [This is where the null causeOfBlockage is important] hudson.model.AbstractProject.getBuildingUpstream(AbtractProject.java:1143) hudson.model.AbstractProject.getCauseOfBlockage(AbtractProject.java:1094) hudson.model.Queue.getCauseOfBlockageForTask(Queue.java:1240) hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1197) -- Start of infinite recursive loop hudson.model.Queue.maintain(Queue.java:1539) -- Starts here
Here's the real stack trace of the stackoverflow
{"thread_name":"jenkins.util.Timer [#1]","message":"Timer task hudson.model.Queue$MaintainTask@73873351 failed","timestamp":"2022-10-12 23:26:54.557","level":"SEVERE","mdc":{},"container":"master","logger_name":"hudson.triggers.SafeTimerTask","source_host":"bdbf33cd8b7c","exception_class":"java.lang.StackOverflowError","stacktrace":"java.lang.StackOverflowError at hudson.model.AbstractProject.getCauseOfBlockage(AbstractProject.java:1077) at hudson.model.Queue.getCauseOfBlockageForTask(Queue.java:1240) at hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1197) at hudson.model.Queue$BlockedItem.getCauseOfBlockage(Queue.java:2630) at hudson.model.AbstractProject.getBuildingUpstream(AbstractProject.java:1143) at hudson.model.AbstractProject.getCauseOfBlockage(AbstractProject.java:1094) at hudson.model.Queue.getCauseOfBlockageForTask(Queue.java:1240) at hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1197) at hudson.model.Queue$BlockedItem.getCauseOfBlockage(Queue.java:2630) at hudson.model.AbstractProject.getBuildingUpstream(AbstractProject.java:1143) at hudson.model.AbstractProject.getCauseOfBlockage(AbstractProject.java:1094) at hudson.model.Queue.getCauseOfBlockageForTask(Queue.java:1240) at hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1197) at hudson.model.Queue$BlockedItem.getCauseOfBlockage(Queue.java:2630) at hudson.model.AbstractProject.getBuildingUpstream(AbstractProject.java:1143) at hudson.model.AbstractProject.getCauseOfBlockage(AbstractProject.java:1094) at hudson.model.Queue.getCauseOfBlockageForTask(Queue.java:1240) at hudson.model.Queue.getCauseOfBlockageForItem(Queue.java:1197) at hudson.model.Queue$BlockedItem.getCauseOfBlockage(Queue.java:2630) And it goes on and on and on... until stackoverflow
- duplicates
-
JENKINS-69419 infinite loop on node startup - Caught exception evaluating: h.escape(item.why) in /ajaxBuildQueue.
- Closed
- links to