Skip to content

Resources are not removed from queue, when timeout is reached #773

@ppiasek

Description

@ppiasek
Environment
Jenkins: 2.503
OS: Linux - 6.11.0-19-generic
Java: 17.0.14 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
antisamy-markup-formatter:173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api:5.4-136.v5a_21779c63f8
asm-api:9.8-135.vb_2239d08ee90
authentication-tokens:1.131.v7199556c3004
blueocean:1.27.18
blueocean-bitbucket-pipeline:1.27.18
blueocean-commons:1.27.18
blueocean-config:1.27.18
blueocean-core-js:1.27.18
blueocean-dashboard:1.27.18
blueocean-display-url:2.4.4
blueocean-events:1.27.18
blueocean-git-pipeline:1.27.18
blueocean-github-pipeline:1.27.18
blueocean-i18n:1.27.18
blueocean-jwt:1.27.18
blueocean-personalization:1.27.18
blueocean-pipeline-api-impl:1.27.18
blueocean-pipeline-editor:1.27.18
blueocean-pipeline-scm-api:1.27.18
blueocean-rest:1.27.18
blueocean-rest-impl:1.27.18
blueocean-web:1.27.18
bootstrap5-api:5.3.5-1
bouncycastle-api:2.30.1.80-256.vf98926042a_9b_
branch-api:2.1217.v43d8b_b_d8b_2c7
build-name-setter:2.5.0
build-timeout:1.37
caffeine-api:3.2.0-166.v72a_6d74b_870f
checks-api:367.v18b_7f530e54a_
cloudbees-bitbucket-branch-source:935.1.3
cloudbees-folder:6.991.v1d5f531726d0
command-launcher:123.v37cfdc92ef67
commons-compress-api:1.27.1-3
commons-lang3-api:3.17.0-87.v5cf526e63b_8b_
commons-text-api:1.13.0-153.v91dcd89e2a_22
config-file-provider:982.vb_a_e458a_37021
configuration-as-code:1947.v7d33fe23569c
coverage:2.2.0
credentials:1413.va_51c53703df1
credentials-binding:687.v619cb_15e923f
dark-theme:524.vd675b_22b_30cb_
dashboard-view:2.528.v3470c02b_d7c9
data-tables-api:2.2.2-1
display-url-api:2.209.v582ed814ff2f
docker-commons:451.vd12c371eeeb_3
docker-workflow:611.v16e84da_6d3ff
durable-task:587.v84b_877235b_45
echarts-api:5.6.0-3
eddsa-api:0.3.0.1-19.vc432d923e5ee
email-ext:1876.v28d8d38315b_d
embeddable-build-status:548.v5653c6e28c41
favorite:2.225.v68765b_b_a_1fa_3
font-awesome-api:6.7.2-1
forensics-api:3.1.0
git:5.7.0
git-client:6.1.3
git-parameter:435.va_f85861c663a_
git-server:137.ve0060b_432302
github:1.43.0
github-api:1.321-488.v9b_c0da_9533f8
github-branch-source:1815.v9152b_2ff7a_1b_
gitlab-plugin:1.9.7
gson-api:2.13.0-133.v5a_e3236a_8251
handy-uri-templates-2-api:2.1.8-36.v85e4cb_234a_13
htmlpublisher:425
instance-identity:203.v15e81a_1b_7a_38
ionicons-api:82.v0597178874e1
jackson2-api:2.18.3-402.v74c4eb_f122b_2
jakarta-activation-api:2.1.3-2
jakarta-mail-api:2.1.3-2
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-133.vb_ec76a_73f706
jdk-tool:83.v417146707a_3d
jenkins-design-language:1.27.18
jersey2-api:2.45-154.v4ded3dc34f81
jjwt-api:0.11.5-120.v0268cf544b_89
jobConfigHistory:1305.vf20a_356586b_8
joda-time-api:2.14.0-127.v7d9da_295a_d51
jquery3-api:3.7.1-3
json-api:20250107-125.v28b_a_ffa_eb_f01
json-path-api:2.9.0-148.v22a_7ffe323ce
jsoup:1.19.1-36.v63b_c859911d0
junit:1322.v1556dc1c59a_f
lockable-resources:1349.v8b_ccb_c5487f7
mailer:489.vd4b_25144138f
matrix-auth:3.2.6
matrix-project:847.v88a_f90ff9f20
metrics:4.2.21-464.vc9fa_a_0d6265d
mina-sshd-api-common:2.15.0-161.vb_200831a_c15b_
mina-sshd-api-core:2.15.0-161.vb_200831a_c15b_
monitoring:2.5.0
nodelabelparameter:759.vb_b_e95db_f3251
okhttp-api:4.11.0-189.v976fa_d3379d6
pam-auth:1.12
parameterized-scheduler:285.ve611986d4c48
parameterized-trigger:840.v3c7d4a_a_5e6c7
pipeline-build-step:567.vea_ce550ece97
pipeline-graph-analysis:235.vb_a_a_36b_f248c2
pipeline-graph-view:423.v765c49ca_da_3f
pipeline-groovy-lib:752.vdddedf804e72
pipeline-input-step:517.vf8e782ee645c
pipeline-milestone-step:127.vb_52887ca_3b_6d
pipeline-model-api:2.2254.v2a_978de46f35
pipeline-model-definition:2.2254.v2a_978de46f35
pipeline-model-extensions:2.2254.v2a_978de46f35
pipeline-stage-step:322.vecffa_99f371c
pipeline-stage-tags-metadata:2.2254.v2a_978de46f35
pipeline-utility-steps:2.19.0
plain-credentials:195.vb_906e9073dee
plugin-util-api:6.1.0
prism-api:1.30.0-1
pubsub-light:1.19
purge-job-history:74.vf21030329dda_
pyenv-pipeline:2.1.2
resource-disposer:0.25
scm-api:704.v3ce5c542825a_
script-security:1373.vb_b_4a_a_c26fa_00
slack:761.v2a_8770f0d169
snakeyaml-api:2.3-125.v4d77857a_b_402
sse-gateway:1.28
ssh-agent:384.ve275343791a_6
ssh-credentials:355.v9b_e5b_cde5003
ssh-slaves:3.1031.v72c6b_883b_869
sshd:3.353.v2b_d33c46e970
structs:343.vdcf37b_a_c81d5
theme-manager:278.v2e3c063e42cc
throttle-concurrents:2.16
timestamper:1.28
token-macro:444.v52de7e9c573d
trilead-api:2.209.v0e69b_c43c245
variant:70.va_d9f17f859e0
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1366.vf1fb_e1a_f6b_22
workflow-basic-steps:1079.vce64b_a_929c5a_
workflow-cps:4046.v90b_1b_9edec67
workflow-durable-task-step:1405.v1fcd4a_d00096
workflow-job:1506.v77f78a_b_8cc5e
workflow-multibranch:806.vb_b_688f609ee9
workflow-scm-step:437.v05a_f66b_e5ef8
workflow-step-api:700.v6e45cb_a_5a_a_21
workflow-support:963.va_600813d04a_a_
ws-cleanup:0.48

Controller - Ubuntu 24
Agents - MacOS / Windows

Steps:

pipeline {

    agent none

    options {
        timeout(time: 460, unit: "MINUTES")
    }

    stages {
    
        stage("Stage 1") {
            steps {
                build(job: job, parameters: parameters)
                )
            }
        }

        stage("Stage 2") {
            steps {
                build(job: job, parameters: parameters)
                )
            }
        }
    }
}

Job job locks some resource.

Expected: When timeout is reached, the queued resources are removed from the queue and the inner jobs are properly terminated.

Actual: When timeout is reached on Stage 1, then Stage 2 is not terminated, because it is waiting for resources. The main pipeline log says:
Body did not finish within grace period; terminating with extreme prejudice
Which results in the inner job from Stage 2 stage being orphaned. The main job is terminated, but the job from Stage 2 is not and is queued for resources.

PS. Couldn't create bug due to https://github.com/orgs/community/discussions/150370 so I created normal issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions