Locking up NR...and escape out from there

I was in discussion with another NR user if NR could "by accident" be so "busy" so it lost responsiveness completely. Only way to "escape out" would be to kill the NR process

I thought I should try this and wrote the following code in a function node:

wait(30000);
node.warn('Waiting is over...');

function wait(ms){
    var start = new Date().getTime();
    var end = start;
    while(end < start + ms) {
        end = new Date().getTime();
    }
}

Initiating this with an inject node and during 30 seconds, yes, NR was totally busy, did not respond to anything else

The commands node-red-stop or sudo systemctl stop nodered.service does not work

In this case my loop ended after 30 seconds and NR was responding again. But if you by mistake have created "a loop forever", I think only chance is then to kill the NR process with pkill -f node-red or similar

Or is there another way (except being very careful when writing code in function nodes)?