Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

By the way - does this discussion matter and were they wrong to use unwrap()?

The way they wrote the code means that having more than 200 features is a hard non-transient error - even if they recovered from it, it meant they'd have had the same error when the code got to the same place.

I'm sure when the process crashed, k8s restarted the pod or something - then it reran the same piece of code and crashed in the same place.

While I don't necessarily agree with crashing as business strategy, I don't think that doing anything other than either dropping the extra rules or allocating more memory - neither of which the original code was built to do (probably by design).

The code made the local hard assumption that there won't ever be more than 200 rules and its okay to crash if that count is exceeded.

If you design your code around an invariant never being violated (which is fine), you have to make it clear on a higher level that they did.

This isn't a Rust problem (though Rust does make it easy to do the wrong thing here imo)





Instead of crashing when applying the new config, it's more common to simply ignore the new config if it cannot be applied. You keep running in the last known good state. Operators then get alerts about the failures and can diagnose and resolve the underlying issue.

That's not always foolproof, e.g. a freshly (re)started process doesn't have any prior state it can fall back to, so it just hard crashes. But restarts are going to be rate limited anyways, so even then there is time to mitigate the issue before it becomes a large scale outage




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: