Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

booni3's avatar

Vapor timeout not being ignored

I have a 60 second timeout set on my jobs and a 90 second vapor queue visibility timeout

abstract class AbstractJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, SerializesModels, InteractsWithQueue, Queueable;

    public $timeout = 60;

    public $tries = 1;

}

vapor.yml

queue-timeout: 90

I am still getting jobs that show up in cloudwatch as timing out after 90 seconds. Why is this?

REPORT  Duration: 90090.19 ms   Billed Duration: 90000 ms   Memory Size: 512 MB Max Memory Used: 213 MB  [+90091ms]

If I change my timeout to 5 seconds, then all my jobs seem to fail as expected.

0 likes
6 replies
themsaid's avatar
themsaid
Best Answer
Level 4

Vapor will run your job until the lambda timeouts, the job specific timeout will be ignored.

booni3's avatar

Can you clarify the situation with JobFailed event and failed job logging when the lambda timeout is hit? I accidentally left my timeout at 5 seconds yesterday queue-timeout: 5 and quite a few jobs run (and failed) overnight. Around 2000 jobs failed but only 10 have been captured in the failed_jobs table with Illuminate\Queue\MaxAttemptsExceededException.

If we timeout the Lambda function I am guessing that Larval shuts down and does not have time to record the failure... but then I still seem to get some. All my jobs are set to public $tries = 1 currently so this is not a failure due to retry attempts.

themsaid's avatar

@lambooni I can see the issue here. Seems like the attempts for the job aren't incremented when the lambda timeouts. Looking into possible solutions.

booni3's avatar

@themsaid I see you have implemented at Laravel\Vapor\VaporJobTimedOutException exception - fast work 😄!

The {Job} has timed out. It will be retried again part; what does this mean exactly? Is this related to the retries parameter on the job? Will the timeout property set on the job also work now?

themsaid's avatar

@booni3 yes a $timeout on the job will be taken into account. The exception means an attempt has timed out and we'll be retrying again.

booni3's avatar

Thanks. I assume attempts is taken into account also? The exception message is a little confusing as even on the final attempt I think it still says this?

Please or to participate in this conversation.