Feng Yi: Classify the error before retrying; retrying a 4xx error a hundred times still burns quota for nothing
On 2026-11-19, X user @Michael_liyang (Feng Yi) wrote: classify the error before retrying; retrying a 4xx error a hundred times still burns quota for nothing. Steps: 1 retry only 429/5xx/timeouts/network disconnects; 2 for 400/401/403/404, return directly and do not enter backoff; 3 for non-retriable errors, only log to D1 and do not burn the upstream. The error code is the switch for retries. Path: failure → determine the error code → back off only if retriable → return directly if not retriable. The author's conclusion: retrying is a way to save money; misclassifying the error is where burning money begins.
- Products
- WorkersD1
- Source
- Author experience𝕏 post
- Author
- Feng Yi (@Michael_liyang)
Key points
- This is a new retry cost-splitting tutorial from this author, and it is not merged into the author's 11/20 cost weekly. The post does not give a specific retry count or bill amount.
Original sources
Published
Original post
Read on 𝕏On 2026-11-19, X user @Michael_liyang (Feng Yi) wrote: classify the error before retrying; retrying a 4xx error a hundred times still burns quota for nothing. Steps: 1 retry only 429/5xx/timeouts/network disconnects; 2 for 400/401/403/404, return directly and do not enter backoff; 3 for non-retriable errors, only log to D1 and do not burn the upstream. The error code is the switch for retries. Path: failure → determine the error code → back off only if retriable → return directly if not retriable. The author's conclusion: retrying is a way to save money; misclassifying the error is where burning money begins.
风易 | AI 工具链
@Michael_liyang · Original 𝕏 post
先说结论:重试前先分错,4xx 的错重试一百次也是白烧额度。 1 只重试 429/5xx/超时/网络断开; 2 400/401/403/404 直接返,别进退避; 3 不可重试的错只记 D1 日志,不烧上游。 错码就是重试的开关。 链路:失败→定错码→可重试才退避→不可重试直接返。 重试是省钱的手段,分错了才是烧钱的开始。
More to read
cloudflare-cost-notify: a Worker cron that posts daily billable usage and free-tier counts to Discord
yutamoty/cloudflare-cost-notify is an unlicensed GitHub repository, pushed on 16 November 2026. A Cloudflare Worker cron at 00:00 UTC (described as 09:00 JST) reads the Billable Usage API and GraphQL Analytics API and posts yesterday’s cost, the day-over-day change, month-to-date spend, and Workers request / R2 storage / R2 Class A and B counts to a Discord webhook. A default $0.00 alert threshold turns the message red. Because the repository has no license, this entry is a summary only and the README is not archived in sources.json.
Kun Save Point (@Savepoint_kk): a D1 bug rewrote unchanged data into a $2,739.12 bill; $2,141 goodwill credit granted.
Kun Save Point (@Savepoint_kk), an indie developer who says he recently lost his job, says a bug repeatedly rewrote unchanged data while inefficient queries amplified reads, producing a $2,739.12 Cloudflare bill already paid via PayPal (D1 rows written $2,641.00, rows read $64.06, other services $34.06); he says his bills were usually under $10 a month. Cloudflare granted a $2,141 goodwill account credit under case #02391058. He asks for it to be converted into a refund to the original PayPal payment, or at least for relief on the $2,641 write charges, and later writes that the initial request was declined and has been reopened for additional review. On October 25 he adds that he missed the only alert email Cloudflare sent, whose amount was not particularly high, and received no further warning before the large card charge; on October 26 he writes that the refund request to the original payment method is still under further review. On November 10 he posts a timeline saying that after following up on November 10–11, support again stated the $2,141 could only remain as account credit and the remaining $598.12 was still undecided while the ticket was being closed.
Turn free allowances into daily budgets with alerts at 70% and 90%
风易 (@Michael_liyang) says 100,000 requests a day and 5 million rows read a day are hard walls, not a safety margin: split production and test into different Workers and D1 databases, alert at 70% and 90%, and degrade before the site returns 500s.