Skip to content

Cap timer delays on Laravel Cloud's managed queues - #1072

Merged
rmcdaniel merged 2 commits into
durable-workflow:1.xfrom
Joel-Jensen:fix/cap-timers-on-laravel-cloud-queues
Nov 11, 2026
Merged

rmcdaniel merged 2 commits into
durable-workflow:1.xfrom
Joel-Jensen:fix/cap-timers-on-laravel-cloud-queues

Conversation

@Joel-Jensen

Copy link
Copy Markdown

Problem

Timers::timer() caps the wake-up job's delay at 900 seconds only when the connection's driver is sqs. Laravel Cloud's managed queues register a cloud driver (Illuminate\Foundation\Cloud\QueueConnector wraps SqsConnector), so on Cloud the cap is skipped and any timer, or awaitWithTimeout(), longer than 15 minutes throws:

Aws\Sqs\Exception\SqsException: Error executing "SendMessage" … InvalidParameterValue (Sender):
Value 1800 for parameter DelaySeconds is invalid. Reason: DelaySeconds must be >= 0 and <= 900.
  at Illuminate\Foundation\Cloud\Queue->later()
  at Workflow\WorkflowStub::timer()

Fix

-if ($driver === 'sqs') {
+// Laravel Cloud's managed queues use the `cloud` driver, which is backed by SQS.
+if (in_array($driver, ['sqs', 'cloud'], true)) {

The early wake-up already re-dispatches until stop_at is reached, so a long timer on Cloud now waits in steps of at most 900 seconds, as it does on plain SQS.

Evidence

  • testTimerCapsDelayForLaravelCloudDriver (a copy of testTimerCapsDelayForSqsDriver on a cloud connection) fails without the change and passes with it.
  • ECS and PHPStan pass on the changed files.

main has the same === 'sqs' check in V2/Support/TimerTransportChunker.php and V2/Support/BackendCapabilities.php, if you want it carried forward.

🤖 Generated with Claude Code

Laravel Cloud's managed queues use the `cloud` driver, which is backed
by SQS and refuses a delay over 900 seconds. The timer only capped its
wake-up for the `sqs` driver, so on Cloud any timer longer than 15
minutes threw an SqsException from SendMessage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Joel-Jensen

Copy link
Copy Markdown
Author

Sorry, Claude went rougue. You can close it if you want. Issue when using Laravel Cloud

@rmcdaniel rmcdaniel added the intake:approved Current issue title and body revision is approved for authority intake label Nov 11, 2026
@rmcdaniel

Copy link
Copy Markdown
Member

Thanks — this is a good catch, and the fix looks right: Laravel Cloud's cloud driver wraps SQS, so it needs the same 900-second cap.

The red checks aren't caused by your change. The 1.x branch's CI fails before checkout because the org now requires SHA-pinned actions. I'm fixing that in #1073; once it merges I'll update this branch and re-run CI. I'll also carry the same fix forward to main (TimerTransportChunker and BackendCapabilities), as you suggested.

@rmcdaniel
rmcdaniel merged commit c58e5b3 into durable-workflow:1.x Nov 11, 2026
8 checks passed
@rmcdaniel

Copy link
Copy Markdown
Member

Merged into 1.x, thanks @Joel-Jensen. No need to apologize; the report and fix were right. On Laravel Cloud, long timers and awaitWithTimeout() now wait in steps of at most 900 seconds, as they already did on plain SQS.

The same fix for 2.x (main) is in #1074, covering Timers, TimerTransportChunker and BackendCapabilities. Both fixes will ship in patch releases.

@rmcdaniel

Copy link
Copy Markdown
Member

Released in 1.1.1, now on Packagist (composer require durable-workflow/workflow:^1.1.1). The 2.x fix (#1074) is merged and ships in 2.23.0 (#1075).

@rmcdaniel

Copy link
Copy Markdown
Member

The 2.x fix is now released too: Workflow 2.23.0.

rsguimaraes-pe pushed a commit to rsguimaraes-pe/workflow that referenced this pull request Nov 13, 2026
Laravel Cloud's managed queues register a `cloud` driver that wraps SQS,
so timers and v2 task dispatches longer than 900 seconds failed with
SQS InvalidParameterValue. Treat `cloud` like `sqs` everywhere the 900s
dispatch cap and SQS release cap apply.

Reported and first fixed for 1.x by Joel-Jensen in durable-workflow#1072.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intake:approved Current issue title and body revision is approved for authority intake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants