Closed cobblermck closed 2 years ago
I think this was just caused by weird plugin versions.
Thought I was past this but I'm not. Sorry - long night already. I installed the 1.2.10 snapshot and it's behaving the same way as 1.2.3 for me at the moment.
jdk17 issue
While it is true that there is a AtomicBoolean
field called acceptingTasks
in DockerTransientNode.java, I don't believe that using such a "normal" (serializable and built-in-to-Java) class is unreasonable here. It's reasonable to expect this kind of usage to "just work".
So, while I can see that there's a problem in this scenario, I don't think that it would be correct to change the docker-plugin code - if you're seeing this issue here then there's probably a lot of other things that won't be working either, and the "proper fix" would be to fix the hudson.XmlFile.write
method (or the methods it calls) so it works on Java17, e.g. by updating com.thoughtworks.xstream.converters.reflection.FieldDictionary
to one that is compatible with Java17.
i.e. this is likely a symptom of a wider jdk17 malaise.
If you're desperate for a workaround to tide you over until that wider issue is fixed then by all means submit a PR ... but unless it's dead simple and "obviously OK" it's unlikely to be merged into the official release (as I don't want to pollute this codebase with workarounds for bugs elsewhere).
Well said and I agree. This was occurring in a rather unhealthy environment last night. I thought I closed it with my jdk17 comment tbh
I'm running into what I think is the same issue; what is the long term fix for this?
Jenkins Core project doesn't have an issue tracker in the GH project and I don't see anything in the Jenkins Jira. The closest I see is https://issues.jenkins.io/browse/JENKINS-68071, but while the error is the same it's a completely different functionality.
what is the long term fix for this?
I opened https://github.com/x-stream/xstream/issues/308 to discuss the long-term fix with the X-Stream developers.
A month later, my pull request to XStream remains unacknowledged, so I integrated https://github.com/jenkinsci/jenkins/pull/7270 toward 2.375. This will provide support for serializing AtomicBoolean
on Java 17, resolving the immediate issue, but serializing classes in the java.util.concurrent
package is still not something we recommend: the implementation and representation of these concurrent types is more complex and prone to error, and we instead suggest declaring the persisted field to be of some simpler type (e.g., boolean
) and using a transient
field for an in-memory representation of a complex type. Though this issue can remain closed, I would ask that a new code cleanup task be filed to cover moving this plugin off AtomicBoolean
at some point in time in the future: while the immediate pain will be resolved in 2.375 by https://github.com/jenkinsci/jenkins/pull/7270, in the long term this plugin would be less fragile if it used a simpler type.
See https://github.com/jenkinsci/workflow-cps-plugin/pull/515 for example.
Jenkins and plugins versions report
Environment
```text Jenkins: 2.346.2 OS: Linux - 5.4.0-1086-azure --- Office-365-Connector:4.15.0 ace-editor:1.1 analysis-model-api:10.10.0 ant:1.11 antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-1.0 artifactory:3.13.2 audit-trail:3.10 authentication-tokens:1.4 azure-app-service:1.0.2 azure-commons:1.1.3 azure-credentials:198.vf9c2fdfde55c azure-function:0.3.3 azure-sdk:61.v6a8af1f5f5b6 azure-vm-agents:9999-SNAPSHOT (private-05/24/2021 10:28-eryc02c) basic-branch-build-strategies:1.3.2 bitbucket:1.1.29 blueocean:1.24.8 blueocean-autofavorite:1.2.4 blueocean-bitbucket-pipeline:1.24.8 blueocean-commons:1.24.8 blueocean-config:1.24.8 blueocean-core-js:1.24.8 blueocean-dashboard:1.24.8 blueocean-display-url:2.4.1 blueocean-events:1.24.8 blueocean-git-pipeline:1.24.8 blueocean-github-pipeline:1.24.8 blueocean-i18n:1.24.8 blueocean-jwt:1.24.8 blueocean-personalization:1.24.8 blueocean-pipeline-api-impl:1.24.8 blueocean-pipeline-editor:1.24.8 blueocean-pipeline-scm-api:1.24.8 blueocean-rest:1.24.8 blueocean-rest-impl:1.24.8 blueocean-web:1.24.8 bootstrap4-api:4.6.0-3 bootstrap5-api:5.1.3-6 bouncycastle-api:2.25 branch-api:2.1044.v2c007e51b_87f build-timestamp:1.0.3 build-user-vars-plugin:1.8 caffeine-api:2.9.2-29.v717aac953ff3 checks-api:1.7.2 cloud-stats:0.27 cloudbees-bitbucket-branch-source:2.9.9 cloudbees-folder:6.714.v79e858ef76a_2 command-launcher:1.6 conditional-buildstep:1.4.1 config-file-provider:3.8.0 copyartifact:1.46.1 credentials:2.6.2 credentials-binding:1.27 cucumber-reports:5.7.1 data-tables-api:1.11.4-4 display-url-api:2.3.5 docker-commons:1.19 docker-java-api:3.1.5.2 docker-plugin:1.2.2 docker-workflow:1.26 durable-task:1.37 echarts-api:5.3.0-2 email-ext:2.83 embeddable-build-status:2.0.3 extended-choice-parameter:0.82 extended-read-permission:3.2 extensible-choice-parameter:1.7.0 external-monitor-job:1.7 favorite:2.3.3 font-awesome-api:6.0.0-1 forensics-api:1.12.0 generic-webhook-trigger:1.77 git:4.7.2 git-client:3.7.2 git-parameter:0.9.13 git-server:1.10 github:1.33.1 github-api:1.123 github-branch-source:2.10.2 gitlab-plugin:1.5.20 gradle:1.36 greenballs:1.15.1 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-1.0 htmlpublisher:1.25 http_request:1.11 ivy:2.1 jackson2-api:2.13.2.20220328-273.v11d70a_b_a_1a_52 jacoco:3.3.0 javadoc:1.6 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.8 jira-steps:1.6.0 jjwt-api:0.11.2-9.c8b45b8bb173 jquery:1.12.4-1 jquery-detached:1.2.1 jquery3-api:3.6.0-2 jsch:0.1.55.2 junit:1.50 ldap:2.7 lockable-resources:2.11 mailer:408.vd726a_1130320 mapdb-api:1.0.9.0 mask-passwords:3.0 matrix-auth:2.6.7 matrix-project:1.20 maven-plugin:3.12 mercurial:2.15 mission-control-view:0.9.16 momentjs:1.1.1 monitoring:1.87.0 multibranch-build-strategy-extension:1.0.10 okhttp-api:3.14.9 pam-auth:1.6 parameterized-trigger:2.44 pipeline-build-step:2.17 pipeline-github-lib:1.0 pipeline-graph-analysis:1.11 pipeline-input-step:2.12 pipeline-milestone-step:1.3.2 pipeline-model-api:1.8.5 pipeline-model-definition:1.8.5 pipeline-model-extensions:1.8.5 pipeline-rest-api:2.19 pipeline-stage-step:2.5 pipeline-stage-tags-metadata:1.8.5 pipeline-stage-view:2.19 pipeline-utility-steps:2.8.0 plain-credentials:1.7 plugin-util-api:2.16.0 popper-api:1.16.1-2 popper2-api:2.11.5-1 postbuild-task:1.9 postbuildscript:3.1.0-369.vb_cc225753c4b_ prism-api:1.26.0-2 pubsub-light:1.16 resource-disposer:0.16 role-strategy:3.1.1 run-condition:1.5 scm-api:602.v6a_81757a_31d2 script-security:1145.vb_cf6cf6ed960 snakeyaml-api:1.29.1 sonar:2.13.1 sse-gateway:1.24 ssh-agent:1.24.1 ssh-credentials:1.19 ssh-slaves:1.33.0 ssh-steps:2.0.0 sshd:3.1.0 structs:318.va_f3ccb_729b_71 subversion:2.15.4 thinBackup:1.10 throttle-concurrents:2.3 timestamper:1.13 token-macro:293.v283932a_0a_b_49 trilead-api:1.0.13 uno-choice:2.5.6 uploaded1674241992762064703:??? uploaded3602274684500494963:??? uploaded553185394649542620:??? uploaded5882287038286726:??? uploaded707806167046363854:??? variant:1.4 veracode-scan:21.6.13.0 view-job-filters:2.3 warnings-ng:9.11.1 windows-slaves:1.8.1 workflow-aggregator:2.6 workflow-api:1143.v2d42f1e9dea_5 workflow-basic-steps:2.23 workflow-cps:2686.v7c37e0578401 workflow-cps-global-lib:570.v21311f4951f8 workflow-durable-task-step:2.39 workflow-job:1174.vdcb_d054cf74a_ workflow-multibranch:711.vdfef37cda_816 workflow-scm-step:2.13 workflow-step-api:622.vb_8e7c15b_c95a_ workflow-support:817.v58126df57338 ws-cleanup:0.39 ```What Operating System are you using (both controller, and any agents involved in the problem)?
Ubuntu 20
Reproduction steps
Start a build which utilizes docker-plugin
Expected Results
A docker container is created, connected to, and job run on it
Actual Results
The job hangs forever. Looking at the Jenkins System log, I see the following over and over again:
Anything else?
No response