-
Improvement
-
Resolution: Unresolved
-
Major
-
Jenkins 2.289.2
durable-task 1.38
pipeline-build-step 2.15
pipeline-graph-analysis 1.11
pipeline-input-step 2.12
pipeline-milestone-step 1.3.2
pipeline-model-api 1.9.1
pipeline-model-definition 1.9.1
pipeline-model-extensions 1.9.1
pipeline-rest-api 2.19
pipeline-stage-step 2.5
pipeline-stage-tags-metadata 1.9.1
pipeline-stage-view 2.19
pipeline-utility-steps 2.8.0Jenkins 2.289.2 durable-task 1.38 pipeline-build-step 2.15 pipeline-graph-analysis 1.11 pipeline-input-step 2.12 pipeline-milestone-step 1.3.2 pipeline-model-api 1.9.1 pipeline-model-definition 1.9.1 pipeline-model-extensions 1.9.1 pipeline-rest-api 2.19 pipeline-stage-step 2.5 pipeline-stage-tags-metadata 1.9.1 pipeline-stage-view 2.19 pipeline-utility-steps 2.8.0
We run a Bash script from a declarative pipeline's sh step on Windows. Intermittently, the pipeline job hangs before it has a chance to write Finished: SUCCESS to the Jenkins console output. Whenever this happens, we find a hung bash.exe process on the job's host node. Its command line:
"C:\Program Files\Git\bin\..\usr\bin\bash.exe" -c "({ while [ -d 'C:\ci@tmp\durable-ea1adebb' -a \! -f 'C:\ci@tmp\durable-ea1adebb\jenkins-result.txt' ]; do touch 'C:\ci@tmp\durable-ea1adebb\jenkins-log.txt'; sleep 3; done } & jsc=durable-d228ea4e86adf412d44f7823efac746d; JENKINS_SERVER_COOKIE=$jsc 'sh' -xe 'C:/ci@tmp/durable-ea1adebb/script.sh' > 'C:\ci@tmp\durable-ea1adebb\jenkins-log.txt' 2>&1; echo $? > 'C:\ci@tmp\durable-ea1adebb\jenkins-result.txt.tmp'; mv 'C:\ci@tmp\durable-ea1adebb\jenkins-result.txt.tmp' 'C:\ci@tmp\durable-ea1adebb\jenkins-result.txt'; wait) >&- 2>&- &"
After some investigation, it appears this happens because the mv command sometimes fails - possibly due to interference by anti-virus software. Please can Pipeline be made more resilient to such failures by retrying the mv command until it succeeds?
Similar past issue for bat steps: https://issues.jenkins.io/browse/JENKINS-50025