#944633 Moreutils parallel does not always flush output on single CPU machine

Package:
moreutils
Source:
moreutils
Description:
additional Unix utilities
Submitter:
Mark Blakeney
Date:
2019-11-14 01:27:03 UTC
Severity:
normal
#944633#5
Date:
2019-11-13 01:37:34 UTC
From:
To:
Running parallel (moreutils) on my normal multi-cpu machines always
(appears) to work fine. However it does not work on any single cpu VPS, e.g
here is a simple example:

bullet:~ cat ./parallel-moreutils-bug
#/bin/bash
parallel-moreutils -j$1 -i sh -c "echo started {}; sleep 1; echo finished
{}" -- $(seq -s' ' $1)
bullet:~ ./parallel-moreutils-bug 2
started 1
started 2
finished 2
bullet:~ ./parallel-moreutils-bug 2
started 2
started 1
finished 2
bullet:~ ./parallel-moreutils-bug 2
started 2
started 1
finished 2
finished 1
bullet:~ nproc
1

Happens on my Arch Linux VPS and also my ubuntu and debian single-cpu VPS
machines with versions 0.60 to 0.63 at least. Works about 40% of the time,
fails about 60%. Doesn't matter what shell I specify in that script.
Specifying an N value higher than the number of cpu's in my multi-cpu
machines does not cause a problem, only on single-cpu as above.

#944633#10
Date:
2019-11-14 01:23:30 UTC
From:
To:
Note if I run the example command under gdb then it always works so that
implies a timing/race condition.