On Thu, 16 Feb 2012 22:21:09 +0100, Laurent Perrin wrote:
I just had a bad surprise on a production server and thought I'd
share it.
I have a complex node process that can open a REPL over a unix socket
for debugging purposes. If I enter invalid code:
- If the code is executed immediately, it reports an error in the
REPL
and continues.
- However, if the code is in a different tick (e.g.
setTimeout/setInterval), it crashes the whole process.
Now, I could add a process.uncaughtException, but I'd rather let the
process crash if a "real" error happen somewhere else. It's not
necessarily a node problem, but it makes the REPL a very dangerous
tool to me.
Is there a safer way to inspect a running process ?
Btw, here's a simple example: http://pastebin.com/ad93YHdk [1]
You can set process.uncaughtException and if someone is connected thru
the REPL, you post the exception and not fail, otherwise log and fail.
This can cover most of the cases. Changing code in production on a REPL
is really dangerous..
---
Diogo R.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en