I have a script written for Node.Js that collects a load of data, processes it, saves and then finishes. Unfortunately something I've done that is preventing the script from finishing and node closing, instead it remains open.
I'll probably just work my way through the changes I've made and try to track it down, but... Is there an easy way to debug node and find out what code / event / callback / connection or whatever, that it's waiting for?
I've had a look at node-inspector but I couldn't figure out how to track down anything keeping it open. Any advice?
When I've had this happen it's most often something like mongodb, amqp etc. That is database connections, network connections. Make sure you close those once you're done processing.
I guess you could use lsof -p <PID> and see what that says. I can see both mongodb and amqp in there.