I have the same problem now on a Windows Server 2008 R2 Standard 64 Bit machine with Jenkins 1.654 and Pipeline plugin 1.15.
I investigated a bit by using this Groovy script:
node
{
for(int i=0; i < 100; ++i)
{
bat('echo "Hello from batch file."' + i.toString())
}
}
Jenkins creates two temporary batch files to run each "bat" call: jenkins-main.bat with the "echo ..." command and jenkins-wrap.bat to redirect output and capture the exit code in two text files jenkins-log.txt and jenkins-result.txt.
At first the Groovy script is executing the bat call a few times correctly and then stops waiting. The console output does nothing but spin this little icon. When this happens, you can find the following state:
- a "durable-XXXXXXXX" folder (x are hex numbers) in a temporary workspace containing the two batch files jenkins-main.bat and jenkins-wrap.bat.
- The task manager does not show any of the batch files executing.
- The two text files jenkins-log.txt and jenkins-result.txt are not there
Now I have found two ways to make Jenkins continue execting the Groovy script:
- run the jenkins-wrap.bat manually
- create the jenkins-log.txt file (can be empty) and the jenkins-result.txt file with a integer number as content, e.g. 0.
I guess there are two ways this could happen (currently I do not know how to verify this): Either the jenkins-wrap.bat terminates without creating the text files. Or there is some race condition in the Jenkins code deleting the text files before they can be read.
I tested it again with local Windows 2012 R2 and it worked fine. However, when it's configured on ec2 using WinRM, the process would never exit.
If slave is conneted using JNLP, the process exits fine.