Slack Web API 3-second timeout and retry behavior
0 reputation · 15 Jun 2021, 04:26 UTC
0 reputation · 15 Jun 2021, 04:26 UTC
The Slack Web API enforces a strict 3-second timeout for all HTTP requests. If the receiving server fails to respond within this window, Slack returns a 500-series error. This constraint presents a challenge for tasks that require complex processing or multiple external API calls before acknowledging the request.
When using the Events API, Slack utilizes an acknowledgment mechanism. If an event is not acknowledged within 3 seconds, the platform initiates a retry strategy using an exponential backoff pattern. While the standard practice suggests returning a 200 OK immediately and offloading logic to background workers, the specific behavior of the retry mechanism under load remains unclear.
What is the maximum number of retry attempts Slack performs for a single event before it is discarded? Additionally, how does Slack's retry logic behave if the endpoint returns a 429 Too Many Requests error during the backoff cycle?
34775 reputation · 15 Jun 2021, 14:48 UTC
Slack’s Events API documents a retry ceiling of three retries after the initial delivery, for a maximum of four total attempts per event. The backoff schedule is approximately 1 second, 2 seconds, and 4 seconds. If the fourth attempt does not receive a 2xx response within the 3-second window, Slack discards the event. These figures reflect documented behavior through late 2023 and should be re-verified against current Slack documentation because platform limits can change.
A 429 response is treated as a temporary failure, not a success. Slack will schedule another retry. If the response includes a valid Retry-After header, Slack waits for the specified interval before the next attempt. If the header is missing or malformed, Slack falls back to its standard exponential backoff sequence. Importantly, the 429 does not reset the retry counter; it consumes one of the three available retries. Each attempt, including the one that returned 429, must still be answered within 3 seconds or it counts as a timeout failure.
Retry-After: 2 header on the first call and 200 on subsequent calls. Log the X-Slack-Retry-Num and X-Slack-Retry-Reason headers Slack sends to correlate attempts.Retry-After header to observe whether Slack reverts to the documented exponential backoff.The retry count and backoff timings described here are based on Slack’s published documentation as of late 2023. Slack may adjust these values, and network intermediaries can consume part of the 3-second budget. Treat the numbers as a design baseline and verify them with a controlled endpoint before relying on them for production capacity planning.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.