Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

The Best Comment I Ever Got Was Someone Proving My Code Wrong

A reader tested Frank Chu’s retry helper and showed it could exceed its intended time budget. The reproducible results changed how he viewed public correction.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frank Chu’s best code-review comment was a reproducible demonstration that his retry helper exceeded its intended time budget. The correction stung at first, he says, but the test made the defect clear—and he left the correction visible so readers who had copied the original code could see it.

What the reader tested

In his September 19, 2026 DEV Community essay, Chu describes a reader who made the retry helper’s behavior observable by stubbing the clock and removing jitter. Those changes made the runs deterministic. The timings below are outcomes reported in Chu’s essay; they have not been independently reproduced here.

As an Amazon Associate I earn from qualifying purchases.

  • With a 45-second budget and Retry-After: 120, the helper ran for 120 seconds and made two attempts.
  • With a 2-second budget and no Retry-After header, it ran for 3 seconds.

Chu traced the overrun to a check that happened before sleeping but did not compare the proposed wait with the time remaining. The helper could therefore sleep past its budget and recognize the excess only on a later loop iteration. As Chu put it, “A wall-clock cap that can only detect an overrun after the overrun is not a cap.” Read Chu’s essay on DEV Community.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the correction mattered beyond one timing bug

The wait must fit inside the remaining budget

A deadline check before a wait is not enough if the wait itself can carry execution past that deadline. The comment focused attention on the behavior that mattered to a caller: not simply whether the helper eventually noticed the budget, but whether it could avoid exceeding it in the first place.

#1 Best Overall
Sale
Game Programming Patterns
  • Brand New in box. The product ships with all relevant accessories

A server-provided delay is not necessarily the whole backoff policy

According to Chu’s account, the comment also flagged e.retry_after or wait: when a server header was present, that expression discarded the helper’s calculated backoff. Whether a server-provided delay should replace, constrain, or otherwise interact with a client’s backoff is a policy decision; the important point in this example is that the code’s behavior should be deliberate rather than an accidental consequence of a fallback expression.

Retry-After can be a date, not just a number

HTTP semantics allow two forms. RFC 9110 section 10.2.3 says, “The Retry-After field value can be either an HTTP-date or a number of seconds to delay after receiving the response.” A parser that accepts only a number of seconds does not handle the full field syntax. The RFC describes the field as guidance for a follow-up request, including expected unavailability after a 503 response and a minimum wait before a redirected request after a 3xx response. RFC 9110, section 10.2.3.

Retries can multiply across layers

The commenter also raised a less visible source of extra calls: an application’s retry loop may call a client library or SDK that retries each call itself. The total number of requests can therefore exceed what the outer loop’s attempt count suggests. Chu’s essay does not identify the SDK or its version, so it does not establish the exact retry configuration involved.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

As one separate, current example, the official OpenAI Python SDK documentation says certain errors are retried twice by default and that this can be configured with max_retries. Its repository implementation parses Retry-After as either a delay or a date and applies its own retry logic. This illustrates why the SDK’s version and configuration matter; it is not evidence that Chu used that SDK. OpenAI Python SDK retries documentation and SDK retry implementation.

What makes this kind of feedback useful

The force of the comment came from a runnable reproduction, not merely a claim that the code looked wrong. A stubbed clock and deterministic jitter removed timing variability, while the chosen cases made the mismatch between the stated budget and observed runtime easy to see. That gave the author a concrete behavior to investigate and correct.

Chu says he updated the post and kept a visible correction so people who had already encountered or copied the original code could find the change. The point is not that every public correction will arrive as a polished test case; it is that a specific, repeatable demonstration can reveal behavior that inspection alone missed.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Questions to ask when reviewing retry behavior

  • Does the deadline account for the next proposed wait, not only the time already spent?
  • How are server-provided delays handled, and does the parser accept both forms allowed by HTTP?
  • How many attempts can each layer make, including the SDK or HTTP client?
  • Do timeout, backoff, and jitter rules fit the application’s total wall-clock deadline?
  • Can the request safely be sent again if an earlier attempt may have reached the server?

The appropriate answers depend on the application and the specific client or SDK. The useful first step is to trace the actual policy across layers rather than infer it from one loop or a default that may change between versions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.