Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console View occasionally shows wrong stages status #504

Open
galindro opened this issue Sep 13, 2024 · 4 comments
Open

Console View occasionally shows wrong stages status #504

galindro opened this issue Sep 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@galindro
Copy link

galindro commented Sep 13, 2024

Jenkins and plugins versions report

Environment
Jenkins: 2.440.3
OS: Linux - 4.18.0-553.16.1.el8_10.x86_64
Java: 17.0.10 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
ace-editor:1.1
ansicolor:1.0.4
antisamy-markup-formatter:162.v0e6ec0fcfcf6
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
apache-httpcomponents-client-5-api:5.2.1-1.0
asm-api:9.6-3.v2e1fa_b_338cd7
authentication-tokens:1.53.v1c90fd9191a_b_
badge:1.12
blueocean:1.27.12
blueocean-bitbucket-pipeline:1.27.12
blueocean-commons:1.27.12
blueocean-config:1.27.12
blueocean-core-js:1.27.12
blueocean-dashboard:1.27.12
blueocean-display-url:2.4.2
blueocean-events:1.27.12
blueocean-git-pipeline:1.27.12
blueocean-github-pipeline:1.27.12
blueocean-i18n:1.27.12
blueocean-jwt:1.27.12
blueocean-personalization:1.27.12
blueocean-pipeline-api-impl:1.27.12
blueocean-pipeline-editor:1.27.12
blueocean-pipeline-scm-api:1.27.12
blueocean-rest:1.27.12
blueocean-rest-impl:1.27.12
blueocean-web:1.27.12
bootstrap5-api:5.3.2-2
bouncycastle-api:2.29
branch-api:2.1152.v6f101e97dd77
build-failure-analyzer:2.4.2
build-monitor-plugin:1.14-745.ve2023a_305f40
caffeine-api:3.1.8-133.v17b_1ff2e0599
checks-api:2.0.2
cloud-stats:316.vd6d6b_292238d
cloudbees-bitbucket-branch-source:883.v041fa_695e9c2
cloudbees-folder:6.858.v898218f3609d
command-launcher:107.v773860566e2e
commons-lang3-api:3.13.0-62.v7d18e55f51e2
commons-text-api:1.11.0-95.v22a_d30ee5d36
configuration-as-code:1775.v810dc950b_514
configuration-as-code-groovy:1.1
credentials:1337.v60b_d7b_c7b_c9f
credentials-binding:642.v737c34dea_6c2
dark-theme:336.v02165cd8c2ee
display-url-api:2.200.vb_9327d658781
docker-commons:439.va_3cb_0a_6a_fb_29
docker-java-api:3.3.4-86.v39b_a_5ede342c
docker-plugin:1.5
durable-task:550.v0930093c4b_a_6
echarts-api:5.4.0-7
favorite:2.208.v91d65b_7792a_c
file-leak-detector:1.12
font-awesome-api:6.4.2-1
git:5.2.1
git-client:4.6.0
git-server:99.101.v720e86326c09
github:1.37.3.1
github-api:1.318-461.v7a_c09c9fa_d63
github-branch-source:1787.v8b_8cd49a_f8f1
handy-uri-templates-2-api:2.1.8-30.v7e777411b_148
htmlpublisher:1.33
instance-identity:173.va_37c494ec4e5
ionicons-api:74.v93d5eb_813d5f
jackson2-api:2.17.0-379.v02de8ec9f64c
jakarta-activation-api:2.1.3-1
jakarta-mail-api:2.1.3-1
javax-activation-api:1.2.0-6
javax-mail-api:1.6.2-9
jaxb:2.3.9-1
jdk-tool:73.vddf737284550
jenkins-design-language:1.27.12
jjwt-api:0.11.5-77.v646c772fddb_0
jnr-posix-api:3.1.18-1
job-dsl:1.85
jobConfigHistory:1229.v3039470161a_d
joda-time-api:2.12.5-5.v5495a_235fedf
jquery3-api:3.7.1-1
jsch:0.2.8-65.v052c39de79b_2
json-api:20231013-17.v1c97069404b_e
junit:1265.v65b_14fa_f12f0
kubernetes:4029.v5712230ccb_f8
kubernetes-client-api:6.8.1-224.vd388fca_4db_3b_
kubernetes-credentials:0.11
ldap:701.vf8619de9160a_
mailer:470.vc91f60c5d8e2
matrix-project:830.v7ea_da_561b_a_34
metrics:4.2.21-449.v6960d7c54c69
mina-sshd-api-common:2.11.0-86.v836f585d47fa_
mina-sshd-api-core:2.11.0-86.v836f585d47fa_
monitoring:1.95.0
okhttp-api:4.11.0-157.v6852a_a_fa_ec11
pipeline-build-step:540.vb_e8849e1a_b_d8
pipeline-graph-analysis:216.vfd8b_ece330ca_
pipeline-graph-view:243.vc9e11fec486a_
pipeline-groovy-lib:689.veec561a_dee13
pipeline-input-step:495.ve9c153f6067b_
pipeline-milestone-step:119.vdfdc43fc3b_9a_
pipeline-model-api:2.2198.v41dd8ef6dd56
pipeline-model-definition:2.2198.v41dd8ef6dd56
pipeline-model-extensions:2.2198.v41dd8ef6dd56
pipeline-stage-step:312.v8cd10304c27a_
pipeline-stage-tags-metadata:2.2198.v41dd8ef6dd56
pipeline-utility-steps:2.16.0
plain-credentials:179.vc5cb_98f6db_38
plugin-util-api:3.6.0
popper2-api:2.11.6-2
prism-api:1.29.0-8
pubsub-light:1.18
resource-disposer:0.23
role-strategy:689.v731678c3e0eb_
scm-api:689.v237b_6d3a_ef7f
script-security:1336.vf33a_a_9863911
snakeyaml-api:2.2-111.vc6598e30cc65
sse-gateway:1.26
ssh-agent:333.v878b_53c89511
ssh-credentials:308.ve4497b_ccd8f4
ssh-slaves:2.916.vd17b_43357ce4
sshd:3.312.v1c601b_c83b_0e
stashNotifier:1.28
structs:337.v1b_04ea_4df7c8
support-core:1371.v709cef748b_d0
theme-manager:193.vcef22f6c5f2b_
timestamper:1.26
token-macro:384.vf35b_f26814ec
trilead-api:2.84.v72119de229b_7
uno-choice:2.7.2
variant:60.v7290fc0eb_b_cd
view-job-filters:377.v66f4b_796e5fa_
workflow-aggregator:596.v8c21c963d92d
workflow-api:1291.v51fd2a_625da_7
workflow-basic-steps:1042.ve7b_140c4a_e0c
workflow-cps:3894.vd0f0248b_a_fc4
workflow-durable-task-step:1336.v768003e07199
workflow-job:1400.v7fd111b_ec82f
workflow-multibranch:773.vc4fe1378f1d5
workflow-scm-step:415.v434365564324
workflow-step-api:657.v03b_e8115821b_
workflow-support:896.v175a_a_9c5b_78f
ws-cleanup:0.45

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux RHEL8

Reproduction steps

  1. Execute the following scripted pipeline into a pipeline job. You need to have the kubernetes plugin installed, but I guess that you will be able to simulate it by using simple nodes.
Pipeline contents
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils

def pipeline(pipeline_stages) {
    def _cloud = "my-cloud"
    def _namespace = "my-namespace"
    podTemplate(
        cloud: _cloud,
        showRawYaml: true,
        namespace: _namespace,
        yaml: '''
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: mycontainer
    image: myimage:latest
    imagePullPolicy: Always
    tty: true
    command:
    - cat
'''
    ) {
        node(POD_LABEL) {
            pipeline_stages()
        }
    }
}

def stage_template(stage_name, body, skip=false) {
    stage(stage_name) {
        if (skip) {
            Utils.markStageSkippedForConditional(stage_name)
        } else {
            container('mycontainer') {
                body()
            }
        }
    }
}

def setup(skip=false) {
    stage_template(
        'build:setup',
        { print("Doing setup") },
        skip
    )
}
def release_check(skip=false) {
    stage_template(
        'build:release_check',
        { print("Doing release_check") },
        skip
    )
}
def build(skip=false) {
    stage_template(
        'build:execute',
        { print("Doing build") },
        skip
    )
}
def unit_test(skip=false) {
    stage_template(
        'test:unit',
        { print("Doing unit_test") },
        skip
    )
}
def release(skip=false) {
    stage_template(
        'build:release',
        { print("Doing release") },
        skip
    )
}

def _package() {
    def pkg_list = [ "PkgA","PkgB","PkgC","PkgD" ]

    def _common_stages = {
        setup(false)
        release_check(false)
        build(false)
        unit_test(true)
        release(true)
    }

    def pkg_pipelines = [:]

    pkg_list.each { pkg ->
        pkg_pipelines[pkg] = {
            pipeline(_common_stages)
        }
    }

    parallel(pkg_pipelines)
}

_package()

Expected Results

test:unit and build:release child stages should always show Skiped and the rest Success in ALL parent stages.

Actual Results

Sometimes, test:unit and build:release child stages shows as Success in some parent stages, though no execution is done inside them. Look at the following printscreens:

Build #3 -> test:unit and build:release shows Skipped in PkgA parent stage:

image

Build #4 -> test:unit and build:release shows Skipped in both PkgA and PkgB parent stages:

image

Anything else?

BlueOcean shows them correctly:

Build #3

image

Build #4

image

Are you interested in contributing a fix?

No response

@galindro galindro added the bug Something isn't working label Sep 13, 2024
@timja
Copy link
Member

timja commented Sep 13, 2024

Could you simplify it down a bit to remove the kubernetes plugin need please?

Does the graph view correctly render it but the console view doesn't?

@galindro
Copy link
Author

galindro commented Sep 13, 2024

Could you simplify it down a bit to remove the kubernetes plugin need please?

I guess this should be enough:

def pipeline(pipeline_stages) {
    node('myNode') {
        pipeline_stages()
    }
}

Graph view displays it incorrectly exactly like Console View:

image

image

@galindro
Copy link
Author

hey @timja, did you have time to look into this issue?

@timja
Copy link
Member

timja commented Oct 23, 2024

I have not had time although contributions are welcome to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants