Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75654

WindowsBatchScript /PowershellScript do not properly monitor heartbeat of bat command steps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • durable-task-plugin
    • None
    • latest jenkins, local windows 10 vm hosting the agent (connected via openssh from the controller)

      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.

            Unassigned Unassigned
            mikecirioli mike cirioli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: