4 ms·
So the whole webserver dies instead of just a worker thread unwinding its stack?
by samus 10d ago
So the whole webserver dies instead of just a worker thread unwinding its stack?
- mahboi 10d agoOh, net/http recovers from a panic inside a handler and sends error 500. I don't know if that was always the default. Where I worked before, our own Go servers didn't recover, and it did cause outages. This is kinda bad practice. Go and Rust panics are similar, they aren't exceptions that you can safely recover from. Say there's a panic in the middle of modifying some global state like a database connection. Hence complaints about the net/http recover like https://github.com/golang/go/issues/25245 https://github.com/golang/go/issues/25245 . But I guess they decided it's worse to let servers crash from trivial mistakes.
- samus 9d agoI mean, it's a smaller issue in a K8s environment as it will just spin up a fresh pod.