4 ms·
> What if your persistent process hangs or crashes for whatever reason? You've got the same problem with your web server, and your operating system kernel. Sim
by wizzwizz4 4y ago
> What if your persistent process hangs or crashes for whatever reason?
You've got the same problem with your web server, and your operating system kernel. Simply write a program that can't hang or crash – at least, not due to an application bug. It takes attention to detail, but this is a lot easier than writing a program that always behaves correctly; if you limit the syscalls you make, use timeouts appropriately, and don't segfault, it's often achievable.
- scotty79 4y agoI don't think any mainstream framework in any mainstream language has these kinds of precautions. Rails? Django? Express? .NET? Do they kill long running requests so they don't affect whole application? Can the application still mostly work despite syntax error in one of the files? Another thing is level of trust. I trust Linux kernel, I trust apache webserver. But some webserver written in scripting language few years ago? Not so much.
- Semaphor 4y ago> .NET? Do they kill long running requests so they don't affect whole application? Not sure about the built-in .net server, but IIS does exactly that. It supports timeout and error/time based restarts for the persistent process.
- alerighi 4y agoWell try in a nodejs server to put a `while(true);` in a request handler. Do you know the answer? The whole process blocks, since nodejs is single process. I trust more the code that I wrote than the code written from others... not because I'm better than others, but because I know what it does, and I know how to fix it if it breaks.
- scotty79 4y agoIt still wouldn't hurt if the framework just killed it after 3 seconds with timeout message.
- rusebor 4y agoErlang