Solution skill
Pub/Sub DEADLINE_EXCEEDED and ack expiry: tune the ack deadline
Complete solution
Shows how to fix pub/Sub DEADLINE_EXCEEDED and ack expiry: tune the ack deadline. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Set the subscription ack deadline above it: gcloud pubsub subscriptions update [SUB] --ack-deadline 300. Set a dead-letter topic with maxdeliveryattempts so failures route out after N tries.
Steps
- Symptoms: gRPC DEADLINE_EXCEEDED on subscribers, or the same message delivered over and over while the handler is still running.
- Meaning: the ack deadline (default 10 seconds, max 600) expired before your code acked. Pub/Sub assumes the message failed and redelivers. Your handler is not broken; its lease is just too short.
- Fix:
- Measure your handler's p99 time. Set the subscription ack deadline above it:
gcloud pubsub subscriptions update [SUB] --ack-deadline 300. - Better: use the streaming pull client library, which extends leases automatically while the handler runs. Manual pull loops do not extend; prefer the library subscriber.
- Cap the damage: set flow control (max outstanding messages) so a slow handler does not accumulate a mountain of redeliveries.
- Poison messages: if one message always exceeds the deadline, it redelivers forever. Set a dead-letter topic with maxdeliveryattempts so failures route out after N tries.
- Do not:
- Set ack deadline to 600 "just in case" for everything. Long deadlines delay redelivery of genuinely failed messages. Match it to the handler.
- Treat DEADLINE_EXCEEDED on the PUBLISH side the same way. Publish deadlines are about network/throughput; subscriber deadlines are about handler time. Different knobs.
- Verify: watch the subscription's unacked message age and redelivery count in Monitoring after the change; duplicates should drop to near zero.
When to use
You are seeing this: Symptoms: gRPC DEADLINEEXCEEDED on subscribers, or the same message delivered over and over while the handler is still running. Use this skill when you run into "Pub/Sub DEADLINEEXCEEDED and ack expiry: tune the ack deadline".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Verified 2026-09-26 on the Pub/Sub troubleshooting docs, which document DEADLINE_EXCEEDED manifestations and timeout behavior. Ack deadline range and dead-letter policy are documented subscription properties.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_1U-8ixwHQ8sFcWp1DBY_hw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pub/Sub DEADLINE_EXCEEDED and ack expiry: tune the ack deadline <span>— Vectle</span></a>