AWS IoT Core jobs created with Timeout configuration - but do not time out

458 views Asked by At

I am running C# code in a lambda function (.net core 2.1), and create jobs for IoT things that are only occasionally connected to the internet. Since I want to have immediate execution of the commands (before the thing goes offline again), I am creating a snapshot job for each command (target is a single IoT thing). I defined a timeout configuration of 5 minutes. My problem is that the jobs are stuck in "Queued" for a long time, when in fact I expected them to time out after 5 minutes.

Code for creating the JobRequest:

var createJobRequest = new CreateJobRequest
{
    Targets = myArn,
    JobId = myJobId,
    TargetSelection = TargetSelection.SNAPSHOT,
    TimeoutConfig = new TimeoutConfig { InProgressTimeoutInMinutes = 5}
};
1

There are 1 answers

0
Valeriy K. On BEST ANSWER

Have the same problem. As described in the documentation inProgressTimeoutInMinutes is the amount of time, in minutes, device has to finish job execution.

Whenever a job execution remains in the IN_PROGRESS status for longer than this interval, the job execution will fail and switch to the terminal TIMED_OUT status.

As you wrote your job execution in queued status. But as described in the docs it is an interval when job execution remains in the IN_PROGRESS status, not Queued. So your device (or application representing the device) must run job, i.e. move execution status from Queued to In_progress. And then, if it can't process the job (hangs for example), after inProgressTimeoutInMinutes AWS will terminate the job.