5 ms·
IME, "retry after a delay" is often much more of an anti-pattern than "pass the error up the stack". That's how you get system's that take an age to do anything
by nicoburns 5y ago
IME, "retry after a delay" is often much more of an anti-pattern than "pass the error up the stack". That's how you get system's that take an age to do anything before eventually failing anyway (or worse, just leaving you with a perma-spinner). As a user, I'd much rather use a system that fails fast, and allows me to easily retry myself.
- samhw 5y agoThis is how the bank I used to work at ended up with app loads taking almost a minute. People don't intuitively understand the impact of transitivity and exponential growth. It is a very, very bad idea to make a habit of using retry-with-backoff as a default for error handling. (That's before we even consider the semantics of errors in stateful programs, the virtues of 'let it crash', etc.)
- erik_seaberg 5y agoThis. You have to pick a layer that is responsible for retries. If every layer does it, you get a failure amplifier that might become a death star laser.
- samhw 5y agoYup. We once analysed a particularly slow query (as in, a specific call to our server, not a path in the abstract) and saw that across the whole cluster it had resulted in eight million retries. And I think it was a 4xx in the end anyway (not that Go is designed for fancy stuff like telling the difference between two kinds of error!).
- marcus_holmes 5y agoThat's why you wrap errors, so you can unwrap them and work out what caused them. But I totally agree that blindly retrying is a bad practice.
- nicoburns 5y ago8 million! How on earth did that happen?