jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-34489] Pipeline 'bat' does not terminate immediately

Open
#354 1 comment 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue pipeline priority:major resolution:unresolved
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


  • assignee: jglick
  • status: Open
  • priority: Major
  • component(s): durable-task-plugin
  • label(s): pipeline, triaged-2018-11, windows
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 2025-12-09

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.