My Jenkins agents are normal workstations that can be turned off. If this happens during a job, I expect Jenkins to fail that job. Instead, the job stalls indefinitely, even after the agent comes back. How do I make it fail instead? Restarting from the last step would be even better, but that is very much a nice to have.
The last log message is
Cannot contact someagent: java.lang.InterruptedException
When I abort the stallling job, I get
Aborted by admin
Sending interrupt signal to process
Click here to forcibly terminate running steps
After 20s process did not stop
What process did not stop? Nothing can possibly be running on the agent at this point.
Jenkins version is latest LTS, the job is a declarative pipeline that invokes PowerShell scripts. An excerpt:
stage('Build')
{
steps
{
powershell '. Tools\\Build\\Build.ps1 -version $env:VERSION'
}
}
stage('Package')
{
steps
{
powershell '. Tools\\Build\\Package.ps1 -artifact $env:ARTIFACT'
archiveArtifacts ARTIFACT
}
}