A 403 on reschedule leaves the queue message stuck for the full 300 s claim

Open
#4,829 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cloud, typescript

Research direction

Start in the processMessage path of @vercel/queue, where the reschedule failure is logged and swallowed, and in handleCallback, which still returns HTTP 200. Then check directiveCallWithRetries, which retries only network errors and 429s, and the world-vercel retry callback tied to #1999. Done means a 403 on reschedule is either retried or falls back to the trigger's retryAfterSeconds, with the test showing the message is not left for the 300 s claim.

Written by the indexing model from the issue text.

Description

What happens

When a step's retry reschedule (changeVisibility) gets a 403 Forbidden, @vercel/queue's processMessage logs Failed to reschedule message for retry: and returns, and handleCallback still answers the push with HTTP 200. The message is then neither acknowledged nor rescheduled, so it only comes back when the push claim expires, about 305 s later.

directiveCallWithRetries retries only network errors and 429s with Retry-After, so a 403 is never retried.

Why it matters

The world-vercel retry callback asks for a 1 s retry after a failed sendMessage, but when Queues answers that sendMessage with 403, the reschedule usually gets the same 403. A step that should retry in 1 s then waits about 5 minutes. We saw 28 of these 403s in 14 days (26 on one day), on production and preview deployments, all using the deployment's OIDC token. In each case we checked, the flow was redelivered 305 s after the failed invocation.

Versions

  • @workflow/world-vercel 5.0.1 with @vercel/queue 0.5.1, and 5.2.0 with @vercel/queue 0.8.0 (both bundled by eve); the retry, reschedule and swallow logic is the same in both.
  • Vercel Functions, iad1.

Asks

  1. Retry the reschedule on 403, or fall back to the trigger's retryAfterSeconds, instead of waiting out the claim.
  2. Is a 403 from Queues on a valid deployment OIDC token expected and transient? Happy to share request ids privately.

Related: #1999, which added the retry callback because the default was a 300 s lock.

Dominant language
TypeScript
Stars
2.5k
Forks
401
Avg merge
1d 21h
Merged PRs (30d)
201

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/workflow

All issues in vercel/workflow

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.