Comment on How One Uncaught Rust Exception Took Out Cloudflare
anon5621@lemmy.ml 1 day ago
It not exactly unwrap fault even if it would wrote in other way it still not work cause of wrong SQL request which spamming with results longer than expected to rust here was protecting from memory leak actually
sugar_in_your_tea@sh.itjust.works 1 day ago
It is unwrap’s fault. If they did it properly, they would’ve had to explicitly deal with the problem, which could clarify exactly what the problem is. In this case, I’d probably use
expect()to add context. Also, when doing anything with strict size requirements, I would also explicitly check the size to make sure it’ll fit, again, for better error reporting.Proper error reporting could’ve made this a 5-min investigation.
Also, the problem in the first place should’ve been caught with unit tests and a test deploy. Our process here is:
And we’re not a massive software shop, we have a few dozen devs in a company of thousands of people. If I worked at Cloudflare, I’d have more rigorous standards given the global impact of a bug (we have a few hundred users, not billions like Cloudflare).