jenkinsci / jenkinsci/durable-task-plugin
[JENKINS-34489] Pipeline 'bat' does not terminate immediately
- Dominant language
- Java
- Stars
- 30
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
When a pipeline job is terminated while executing a batch script, it will sometimes continue running the batch file after terminating the batch file's child process. This means you cannot reliably check if the process was terminated by Jenkins or if it exited normally. See attached script and log.
To test, run the attached pipeline script and terminate while in the middle of pinging. Most of the time it will continue to run the batch file after jenkins kills ping. I would expect the batch file to also stop.
I've also attached a log of where ping terminated but the job hung and had to be force killed. (but probably related to the other bat issues)
---
Originally reported by
sonneveldsmartward, imported from: Pipeline 'bat' does not terminate immediately
jglick
Raw content of original issue
When a pipeline job is terminated while executing a batch script, it will sometimes continue running the batch file after terminating the batch file's child process. This means you cannot reliably check if the process was terminated by Jenkins or if it exited normally. See attached script and log.
To test, run the attached pipeline script and terminate while in the middle of pinging. Most of the time it will continue to run the batch file after jenkins kills ping. I would expect the batch file to also stop.
I've also attached a log of where ping terminated but the job hung and had to be force killed. (but probably related to the other bat issues)
- environment:
Jenkins 2.0, Windows 2012 R2
4 attachments
- [jenkins-capture-error-error.log](https://issues.jenkins.io/secure/attachment/32555/jenkins-capture-error-error.log)
- [jenkins-capture-error-failed-to-terminate-at-all.log](https://issues.jenkins.io/secure/attachment/32552/jenkins-capture-error-failed-to-terminate-at-all.log)
- [jenkins-capture-error-succes.log](https://issues.jenkins.io/secure/attachment/32554/jenkins-capture-error-succes.log)
- [jenkins-capture-error.groovy](https://issues.jenkins.io/secure/attachment/32553/jenkins-capture-error.groovy)
Contributor guide
Assessment
This issue has not been assessed yet.