Skip to content

[JENKINS-75654] WindowsBatchScript /PowershellScript do not properly monitor heartbeat of bat command steps #517

@jenkins-infra-bot

Description

@jenkins-infra-bot

For my testing i used a local windows 10 VM running openssh, which allowed me to simulate the loss of the agent (by killing the agent, or by killing sshd depending on what i want to see happen). Stand up a controller and create a permanent agent (via ssh) on the windows machine. You should pass the following system properties to the instance:

JENKINS_OPTIONS="-Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.USE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.PowershellScript.USE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.USE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.LAUNCH_DIAGNOSTICS=true -Dorg.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING=true -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=30

I used the following job to test:

pipeline {
agent

Unknown macro: { label 'seco' }

stages {
stage('Long Running Process') {
steps

Unknown macro: {echo "Starting long-running process on Windows node"// Use a single command with ping to create a long-running process// Ping 127.0.0.1 1800 times with 1 second interval = 30 minutes//bat 'ping 127.0.0.1 -n 1800 > null'bat 'ping 127.0.0.1 -n 1800'//bat 'c}

}
}
}

With the current implementation (latest sources from URR) you will see that if you kill the agent after the job has started that it will continue to appear to be ‘running’ from the POV of jenkins even though the underlying processes are no longer running.


Originally reported by mikecirioli, imported from: WindowsBatchScript /PowershellScript do not properly monitor heartbeat of bat command steps
  • status: Open
  • priority: Minor
  • component(s): durable-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09
Raw content of original issue

For my testing i used a local windows 10 VM running openssh, which allowed me to simulate the loss of the agent (by killing the agent, or by killing sshd depending on what i want to see happen). Stand up a controller and create a permanent agent (via ssh) on the windows machine. You should pass the following system properties to the instance:

JENKINS_OPTIONS="-Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.USE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.PowershellScript.USE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.USE_BINARY_WRAPPER=true -Dorg.jenkinsci.plugins.durabletask.WindowsBatchScript.LAUNCH_DIAGNOSTICS=true -Dorg.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep.USE_WATCHING=true -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=30

I used the following job to test:

pipeline { agent

Unknown macro: { label 'seco' }

stages { stage('Long Running Process') { steps

Unknown macro: { echo "Starting long-running process on Windows node" // Use a single command with ping to create a long-running process // Ping 127.0.0.1 1800 times with 1 second interval = 30 minutes //bat 'ping 127.0.0.1 -n 1800 > null' bat 'ping 127.0.0.1 -n 1800' //bat 'c}

} } }

With the current implementation (latest sources from URR) you will see that if you kill the agent after the job has started that it will continue to appear to be ‘running’ from the POV of jenkins even though the underlying processes are no longer running.

  • environment: latest jenkins, local windows 10 vm hosting the agent (connected via openssh from the controller)

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions