-
Bug
-
Resolution: Unresolved
-
Minor
-
None
An aborted build should have the status ABORTED. The status is FAILURE if the build gets aborted during the initial checkout. An interrupted exception should be handled gracefully and lead to ABORTED (also no repeats of the checkout should be triggered).
I came across this issue while working on JENKINS-72819. Here the InterruptedException is causing a NPE in the exception handler in the git-client-plugin. After fixing this issue I now get the following call stack in case of an early abort. The last line is saying FAILURE which should be ABORTED.
ERROR: Checkout failed
java.lang.InterruptedException
at java.base/java.lang.Object.wait(Native Method)
at java.base/java.lang.Object.wait(Unknown Source)
at java.base/java.lang.ProcessImpl.waitFor(Unknown Source)
at hudson.Proc$LocalProc.join(Proc.java:328)
at hudson.Proc.joinWithTimeout(Proc.java:172)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2839)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:871)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1222)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:165)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:71)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
ERROR: Maximum checkout retry attempts reached, aborting
Finished: FAILURE
- relates to
-
JENKINS-46961 Pipelines interrupted while starting incorrectly resume after Jenkins restarts and cannot be killed
-
- Reopened
-
-
JENKINS-72819 NPE in CliGitAPIImpl.launchCommandIn() caused by InterruptedException
-
- Closed
-
I figured out two places causing this behaviour:
jglick Why is Thread.interrupted() not returning true here? I can provide PRs for these two points if this all makes sense to you.