jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
116 stars 189 forks source link

Does the plugin support continuation-passing style (CPS) to survive Jenkins restarts? #902

Open michalszelagsonos opened 12 months ago

michalszelagsonos commented 12 months ago

We see occasional Jenkins controller restarts which is not unusual. This can happen for various reasons and since our jobs are pipelines, running in max durability mode, most of the time we can resume without a hitch. That being said, from time to time, we do see that Jenkins fails to resume if the pipeline was interrupted while using the Artifactory plugin, specifically, rtUpload step. Here's a log example of what happens, sensitive data redacted:

16:22:41  Executing command: /bin/sh -c git log --pretty=format:%s -1
16:22:42  [consumer_0] Deploying artifact: https://artifactory.***/PR-1035/10/version___0.15.0-PR_1035.development%2B20231127.39bc989___do_not_click
16:22:44  [consumer_1] Deploying artifact: https://artifactory.***/PR-1035/10/build/app-dev-debug.apk
16:22:45  [consumer_2] Deploying artifact: https://artifactory.***/PR-1035/10/build/app-dev-release.aab
16:24:57  Resuming build at Mon Nov 27 21:24:57 UTC 2023 after Jenkins restart
16:24:57  Waiting for reconnection of ***-pr-1035-10-8tsmn-rwp79-xb4t4 before proceeding with build
16:25:41  Timeout set to expire in 18 min
16:25:41  Ready to run at Mon Nov 27 21:25:41 UTC 2023
16:25:42  [Pipeline] catchError
16:25:42  [Pipeline] {
16:25:42  [Pipeline] githubNotify
16:25:43  [Pipeline] error
16:25:43  [Pipeline] }
16:25:43  ERROR: Publishing failed: org.jenkinsci.plugins.workflow.steps.SynchronousResumeNotSupportedException: Resume after a restart not supported for non-blocking synchronous steps

I suspect this related to continuation-passing style (CPS) and how Jenkins serializes the pipeline and resumes when controller restarts. My question is, is this supported by the plugin?

More on Jenkins serialization and durability here, scroll to Avoiding NotSerializableException section: https://www.jenkins.io/doc/book/pipeline/pipeline-best-practices/