Do not leak processes. In the simple case, it is as bad as leaking
memory, and worst, the leaked process may monopolize external resources
like files, or a database, etc.
I expect GNU Parallel to wait until everything it has started also has
completed, and I also expect GNU Parallel to return a non-zero exit code
if one of the processes it launched returned a non-zero.
If you don't want to wait for GNU Parallel, then backgroud GNU Parallel
itself, and hold on to that PID if you want, but do not let children
leak to the OS by default.
GNU Make, which has a parallel feature, does not leak processes. GNU
Parallel should not leak either.
Martin
On 16-05-23 06:46 PM, Ole Tange wrote:
Should GNU Parallel ignore, kill or wait for background children?
Example:
$ parallel '(sleep 100) & echo' ::: 1
1
$ ps -opid,pgrp,cmd
PID PGRP CMD
915719 915719 /bin/bash
937618 937617 sleep 100
937620 937620 ps -opid,pgrp,cmd
The sleep is put in the background. The echo finishes, and GNU
Parallel exits, while the sleep is still running.
Is this what you expect?
Or do you expect GNU Parallel to wait for the background job? Should
it do that for every job? Or just when GNU Parallel is about to exit?
Or do you expect GNU Parallel to kill the background job? Should it do
that for every job? Or just when GNU Parallel is about to exit?
/Ole