I've been experimenting with Node JS and I was wondering what would happen if the script gets stuck in a loop. I.e. while(true);
I'll tell you what happens: it keeps running that loop; running one core at 100% until the end of time and stops responding to any events, even if they come from other clients/IPs (assuming Node is running a webserver that is). Basically a dead server because of one script bug, which strikes me as quite poor.
The other less than ideal thing I've discovered is that (by default at least) runtime errors result in it calling exit(), which again takes down the whole server rather than just the one connection.
What do people who use NodeJS for serious stuff do? Or is it a case of don't write code with bugs in it?
I'll tell you what happens: it keeps running that loop; running one core at 100% until the end of time and stops responding to any events, even if they come from other clients/IPs (assuming Node is running a webserver that is). Basically a dead server because of one script bug, which strikes me as quite poor.
The other less than ideal thing I've discovered is that (by default at least) runtime errors result in it calling exit(), which again takes down the whole server rather than just the one connection.
What do people who use NodeJS for serious stuff do? Or is it a case of don't write code with bugs in it?
Comment