fix(discord): widen slash-sync timeout to 600s under rate-limit pressure (#16713) - #17029
Conversation
…ure (#16713) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR #16739 and @davidbordenwi for reporting #16713 with the bucket-math diagnosis. Closes #16713.
🚨 CRITICAL Supply Chain Risk DetectedThis PR contains a pattern that has been used in real supply chain attacks. A maintainer must review the flagged code carefully before merging. 🚨 CRITICAL: Install-hook file added or modifiedThese files can execute code during package installation or interpreter startup. Files: Scanner only fires on high-signal indicators: .pth files, base64+exec/eval combos, subprocess with encoded commands, or install-hook files. Low-signal warnings were removed intentionally — if you're seeing this comment, the finding is worth inspecting. |
…ure (#16713) (#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR #16739 and @davidbordenwi for reporting #16713 with the bucket-math diagnosis. Closes #16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
|
Sharing a related data point from a Windows Discord gateway deployment. We saw intermittent Discord send 429 pressure around long/chunked replies. A local mitigation that helped was pacing outbound Discord This did not look related to a separate silent |
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
…ure (NousResearch#16713) (NousResearch#17029) Discord's per-app command-management bucket is ~5 writes / 20 s. A mass-prune-plus-upsert reconcile (77 orphans + 30 desired = 107 writes in the reported case) can't finish under the old flat 30 s budget, and the subsequent reconnect retries inside the rate-limit cooldown also time out — leaving slash commands broken for ~60 min until the bucket fully recovers. Bump the timeout to 600 s so realistic bursts drain, update the warning message to point at the saturated bucket instead of a hardcoded 30 s. The 600 s cap still guards against a true hang. Credit to @Tranquil-Flow for PR NousResearch#16739 and @davidbordenwi for reporting NousResearch#16713 with the bucket-math diagnosis. Closes NousResearch#16713. Co-authored-by: Teknium <teknium@nousresearch.com>
Summary
Bumps the outer
asyncio.wait_foraround_safe_sync_slash_commandsfrom 30 s to 600 s so mass-prune-plus-upsert reconciles drain under Discord's ~5-writes/20-s command-management bucket. The 600 s cap still guards against a true hang.Root cause: flat 30 s budget. A 107-write reconcile (77 orphans + 30 desired, from the bug report) needs several minutes of forced rate-limit waits to finish; the old budget cancelled mid-loop, subsequent reconnects inside the cooldown also timed out, and slash commands stayed broken for ~60 min until the bucket fully recovered.
Simpler alternative to #16739's plan/execute split + write-count-derived budget — the 600 s ceiling is the only load-bearing number.
Changes
gateway/platforms/discord.py_run_post_connect_initialization: timeout 30 → 600, warning message updated to point at saturated bucket.Validation
tests/gateway/test_discord_connect.pyCredit: @Tranquil-Flow (PR #16739) and @davidbordenwi (issue #16713 bucket-math diagnosis).
Closes #16713.