When batch task is included in a Pipeline job it will hang on completion of the batch task. I can see in task manager that the job startup it logs data to jenkins-log.txt. The batch completes and I see in task manager that the batch is nolonger running. But Jenkins is still waiting for the task to complete. I do not see jenkins-result.txt writen to the workspace tmp durabletask directory. If I create the file manually or run the workflow-wrap.bat manually the task completes. This is an itermitent bug. Task might work 3 time then fail 5 times then work 8 times. No change to the system during this time. I am setting the job to run every min to see what the stats look like for longer run.

      job:

      node { 
       bat 'ping 127.0.0.1 -n 10'
       echo 'batch completed'
      }
      

      Could be any command you want ping is just an easy one to have it take a little bit of time. And require nothing else installed on machine.

      I see many other task like this I have tested on serveral differnt machines using a base install of Jenkins.

        1. durable-task.hpi
          41 kB
        2. durable-task.hpi
          41 kB
        3. How.png
          How.png
          321 kB
        4. jenkins2-pipeline-batch-hang.png
          jenkins2-pipeline-batch-hang.png
          109 kB
        5. jenkins2-pipeline-batch-nohang.png
          jenkins2-pipeline-batch-nohang.png
          98 kB

          [JENKINS-34150] Pipeline Batch hangs

          Sam Van Oort added a comment -

          lidl Does it work if you set 'returnStdOut: true', and if so, please try the attached hotfix and let us know if this resolves it.

          Sam Van Oort added a comment - lidl Does it work if you set 'returnStdOut: true', and if so, please try the attached hotfix and let us know if this resolves it.

          Steven Foster added a comment -

          returnStdout: true has the same result. confirmed the process is finished on the machine.

          Steven Foster added a comment - returnStdout: true has the same result. confirmed the process is finished on the machine.

          Sam Van Oort added a comment -

          stevenfoster In the control directory in the build agent's workspace for this job (where there's a jenkins-main.bat and jenkins-wrap.bat) do you see a jenkins-result.txt file, a jenkins-result.txt.tmp, or both?

          I'm trying to figure out what actually triggered this because it did not fail any of our unit tests that should have explicitly covered this functionality.

          Sam Van Oort added a comment - stevenfoster In the control directory in the build agent's workspace for this job (where there's a jenkins-main.bat and jenkins-wrap.bat) do you see a jenkins-result.txt file, a jenkins-result.txt.tmp, or both? I'm trying to figure out what actually triggered this because it did not fail any of our unit tests that should have explicitly covered this functionality.

          Steven Foster added a comment -

          just the .tmp

          Steven Foster added a comment - just the .tmp

          Sam Van Oort added a comment -

          stevenfoster Okay, that means the "move" operation failed to rename the file, which should basically never happen. Would you be able to hop on #jenkins IRC briefly to discuss (I'm svanoort there)? It should be a quick and trivial fix but since we can't reproduce the issue in our own environment, it would be super-helpful to be able to see a case where it happened.

          Sam Van Oort added a comment - stevenfoster Okay, that means the "move" operation failed to rename the file, which should basically never happen. Would you be able to hop on #jenkins IRC briefly to discuss (I'm svanoort there)? It should be a quick and trivial fix but since we can't reproduce the issue in our own environment, it would be super-helpful to be able to see a case where it happened.

          Sven Brosi added a comment - - edited

          svanoort: Can not test it again, as it is a corporate jenkins and i can not  up- and downgrade the plugins on the fly.

          How can i still help you?

          Sven Brosi added a comment - - edited svanoort : Can not test it again, as it is a corporate jenkins and i can not  up- and downgrade the plugins on the fly. How can i still help you?

          Sam Van Oort added a comment -

          lidl Don't worry about it, stevenfoster was thankfully available to help debug in an environment where this is reproducible (thanks!).

          I'm attaching one more hotfix version for him to try out which should fully resolve the issue. durable-task.hpi

          Sam Van Oort added a comment - lidl Don't worry about it, stevenfoster was thankfully available to help debug in an environment where this is reproducible (thanks!). I'm attaching one more hotfix version for him to try out which should fully resolve the issue. durable-task.hpi

          Sam Van Oort added a comment -

          This issue duplicates symptoms of JENKINS-50025 but the root causes are significantly different, so that is being tracked separately.

          Sam Van Oort added a comment - This issue duplicates symptoms of JENKINS-50025 but the root causes are significantly different, so that is being tracked separately.

          Sam Van Oort added a comment -

          lidl stevenfoster I'm closing THIS issue because while the result is the same this has a different cause and is resolved in JENKINS-50025.

          Sam Van Oort added a comment - lidl stevenfoster I'm closing THIS issue because while the result is the same this has a different cause and is resolved in JENKINS-50025 .

          Sam Van Oort added a comment -

          lidl stevenfoster Released fix after review and testing as durable-task-plugin 1.21

          Sam Van Oort added a comment - lidl stevenfoster Released fix after review and testing as durable-task-plugin 1.21

            amuniz Antonio Muñiz
            dpd_30 Daniel Daugherty
            Votes:
            18 Vote for this issue
            Watchers:
            34 Start watching this issue

              Created:
              Updated:
              Resolved: