setTimeout stops working in node.js

I'm using this in node.js in order to run a function at random intervals, on a larger scale this will be done in hours, however this code seems to hang after ~3 seconds.

(function loop(timer){
    if(!timer) timer = 900;
    console.log('Timer is '+ timer);
    setTimeout(function(){
        var timer = Math.floor(Math.random() * (4000 + 1)) + 1000;
        //doSomething();
        loop(timer );
    }, timer);
})();

Used in the browser I'll get the expected result.

Timer is 900
Timer is 1895
Timer is 2839
Timer is 4752
Timer is 4556
Timer is 2115

But in node.js, it'll get to this point and hang.

Timer is 900
Timer is 4975

Node.js version is v0.7.10-pre if that helps.