parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

VOTE: --timeout with suspendable children or killing children?


From: Ole Tange
Subject: VOTE: --timeout with suspendable children or killing children?
Date: Thu, 1 Dec 2011 00:27:35 +0100

In the following note the big difference between the option --timeout
and the command timeout.

--timeout right now kills the job running. It does not kill off any
children started by the job:

echo 'sleep 60; true' | parallel --timeout=3
ps f -t $(tty) -o pid,pgid,args
[ ... the $SHELL started is killed, but the sleep 60 is still running ... ]

A solution to that is using the command 'timeout':

echo 'sleep 60; true' | parallel timeout 3 bash -c {}
ps f -t $(tty) -o pid,pgid,args

A problem by that is that you have to install 'timeout' (on Debian it
is part of coreutils, so it might not be a big issue).

Another problem is that suspend (CTRL-Z) will not suspend the children:

parallel -q timeout 10 perl -e '$a=1;while($a<{}){$a++}' :::
1000000000 1000000001
<CTRL-Z>
top
[ ... 2 perl processes take up 100% CPU ... ]

Right now suspending works:

parallel -q --timeout 10 perl -e '$a=1;while($a<{}){$a++}' :::
1000000000 1000000001
<CTRL-Z>
top
[ ... 2 perl processes take up 0% CPU ... ]

I do not see a way to implement both, so you should now vote:

[ ] I prefer the current behaviour (CTRL-Z suspends children when
using --timeout)
[ ] I prefer --timeout kills off a job's children (CTRL-Z suspends
parallel, but not children when using --timeout)


/Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]