Hacker News new | past | comments | ask | show | jobs | submit login

You can always restart the process after an abort(). Continuing to run a server with persistent in-process state after an unexpected exception is dangerous and you risk corrupting data.



Many servers do not have persistent in-process state, or have in-process state that is robust against bugs in other parts of the program. In particular, in most languages where you need special syntax or data types to access shared state (so, definitely not C or C++, but Python should count), you can isolate all the code that doesn't use this syntax or these types of objects inside a giant try/catch, and know that any misbehavior inside that block of code cannot possibly have affected the shared state.


This is not scalable. A production server might import code from dozens, if not hundreds of modules, all of which have varying degrees of code quality and are written by different authors from different organizations. It's not practical to trust that all the code is written in a way that is exception-safe. Try:catch:log:continue is a hazard and signal that the person who wrote the code hasn't thought very deeply about correctness.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: