Retry Loop Retry
Posted4 months agoActive4 months ago
matklad.github.ioTechstory
calmneutral
Debate
40/100
Retry MechanismsError HandlingProgramming
Key topics
Retry Mechanisms
Error Handling
Programming
The article discusses the implementation of retry loops in programming, and the discussion revolves around different approaches to handling retries and transient errors.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
4d
Peak period
4
96-102h
Avg / period
2
Key moments
- 01Story posted
Aug 23, 2025 at 10:00 AM EDT
4 months ago
Step 01 - 02First comment
Aug 27, 2025 at 3:57 AM EDT
4d after posting
Step 02 - 03Peak activity
4 comments in 96-102h
Hottest window of the conversation
Step 03 - 04Latest activity
Aug 27, 2025 at 3:10 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 44996045Type: storyLast synced: 11/20/2025, 11:29:11 AM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
IMHO, such a block would be more useful than the "else" block in loops, although of course, you can always emulate it as
1. Allowing user initiated early retry exit. Nothing is stopping some other developer from wrapping your function-with-retries in their own retry-able function. And then another developer even further removed from the details to wrap that one again. Now you have n pow 3 retries and you have services timing out after an hour instead of milliseconds or seconds. Remember that your function-with-retries can just look like a slower flakey function to them. Perhaps exposing the retry variables in the api is the answer, perhaps not.
2. Code readability and debug-ability. Wrapping a piece of work in a function pointer and giving it a generic name like “action” increases cognitive load and makes the codebase slower to read. This is especially true if the contents of the action is so far up the boilerplate chain that the developer has already forgotten what it does. This is a part of the codebase that will be read to troubleshoot the failure so it helps if it is self describing.
3. In my experience, retries are often added when the failure mode is not well understood or as a quick hack to get things over the line. However, we sometimes cannot control what we call so they are an also valid mechanism to use under certain circumstances.