[JIRA] (JENKINS-25519) NumberFormatException from exitStatus can cause DurableTaskStep.Execution.check problems

2 views
Skip to first unread message

svanoort@cloudbees.com (JIRA)

unread,
Mar 6, 2018, 12:14:02 PM3/6/18
to jenkinsc...@googlegroups.com
Sam Van Oort updated an issue
 
Jenkins / Bug JENKINS-25519
NumberFormatException from exitStatus can cause DurableTaskStep.Execution.check problems
Change By: Sam Van Oort
Summary: Rethrown NumberFormatException from exitStatus can cause DurableTaskStep.Execution.check to retry indefinitely problems
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

svanoort@cloudbees.com (JIRA)

unread,
Mar 6, 2018, 12:15:02 PM3/6/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Mar 6, 2018, 12:16:02 PM3/6/18
to jenkinsc...@googlegroups.com
Sam Van Oort updated an issue
Change By: Sam Van Oort
ON OLD DURABLE TASK VERSIONS:
https://jenkins.ci.cloudbees.com/job/plugins/job/workflow-plugin/org.jenkins-ci.plugins.workflow$workflow-aggregator/572/testReport/junit/org.jenkinsci.plugins.workflow.steps/TimeoutStepTest/basic/ showed repeated warnings:

{code:none}
... org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution check
FINE: could not check .../workspace/p
java.io.IOException: corrupted content in .../workspace/p/.a883d971/jenkins-result.txt: java.lang.NumberFormatException: For input string: ""
at org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.exitStatus(FileMonitoringTask.java:136)
at org.jenkinsci.plugins.durabletask.BourneShellScript$ShellController.exitStatus(BourneShellScript.java:123)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:188)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:151)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:504)
at java.lang.Integer.parseInt(Integer.java:527)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.exitStatus(FileMonitoringTask.java:134)
... 10 more
{code}

Unclear what caused {{jenkins-result.txt}} to be empty rather than contain a number, but at any rate there is a problem in {{DurableTaskStep}} that it continued to recheck the workspace every 15s and never gave up. {{FileMonitoringController}} could perhaps mark this exception as "fatal" rather than "transient", but that leaves it open to a race condition if the exit status is still being checked while written. So it is probably the responsibility of the caller ({{check}}) to give up and mark the step failed if {{exitStatus}} repeatedly throws an exception. (As distinct from {{getWorkspace}} repeatedly being null, which is normal enough if the slave stays offline for a while.)


On NEW versions of Pipeline the error is different, and instead the pipeline fails:

{code:none}
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.parseInt(Integer.java:615)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.exitStatus(FileMonitoringTask.java:168)
Caused: java.io.IOException: corrupted content in $SOMEPLACE
at org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController.exitStatus(FileMonitoringTask.java:170)
at org.jenkinsci.plugins.durabletask.BourneShellScript$ShellController.exitStatus(BourneShellScript.java:211)
{code}

svanoort@cloudbees.com (JIRA)

unread,
Mar 6, 2018, 12:17:02 PM3/6/18
to jenkinsc...@googlegroups.com
Sam Van Oort resolved as Fixed
 

Merged, pending release.

Change By: Sam Van Oort
Status: Open Resolved
Resolution: Fixed

svanoort@cloudbees.com (JIRA)

unread,
Mar 6, 2018, 12:17:02 PM3/6/18
to jenkinsc...@googlegroups.com
 
Re: NumberFormatException from exitStatus can cause DurableTaskStep.Execution.check problems

Root case turned out to be that the statusCode file was created before being written to, and could be checked while empty.

svanoort@cloudbees.com (JIRA)

unread,
Mar 6, 2018, 12:56:02 PM3/6/18
to jenkinsc...@googlegroups.com
Sam Van Oort closed an issue as Fixed
 

Released with v.1.19

Change By: Sam Van Oort
Status: Resolved Closed
Assignee: Sam Van Oort
Reply all
Reply to author
Forward
0 new messages