coreutils/src/uu
Jan Scheer 5258dec9a8
tail: fix race condition (#3798)
* tail: fix race condition (fix #3765)

There exists a race condition (RC) that can occur if changes to a path
happen after the initial print loop in `uu_tail()`, but before the
path is added to the notify-Watcher thread in `follow()`.

To minimize the window where the RC can occur, this moves starting the
Watcher thread and adding paths to it from `follow()` to the initial
print loop in `uu_tail()`.

Additionally, to make sure the RC cannot happen in
"gnu/tests/tail-2/F-headers.sh", the error message that is used as a trigger
in this test, is delayed until the path is added to the Watcher thread.

* build-gnu: remove workarounds for tail

Remove workarounds for "tests/tail-2/F-headers.sh" which are
(presumably) no longer needed because of the race condition fix.

* build-gnu: remove workarounds for tail

Remove workarounds for "tests/tail-2/F-headers.sh" which are
(presumably) no longer needed because of the race condition fix.

* tail: refactor to minimize chances of RC

Move "adding paths to Watcher thread" to its own loop and run this loop
before the initial tail-print-loop in order to minimize the window for
race conditions.
2022-08-14 01:01:15 +02:00
..
arch bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
base32 Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
base64 Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
basename Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
basenc Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
cat Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
chcon Use u64 instead of ino_t/dev_t types 2022-08-06 02:50:19 -04:00
chgrp bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
chmod Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
chown bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
chroot Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
cksum Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
comm Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
cp Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
csplit Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
cut Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
date Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
dd Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
df Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
dir Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
dircolors Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
dirname Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
du du: remove useless transmute to fix clippy warning 2022-08-12 10:56:13 +02:00
echo Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
env Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
expand Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
expr Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
factor Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
false bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
fmt Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
fold Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
groups Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
hashsum Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
head Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
hostid Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
hostname Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
id Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
install Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
join Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
kill Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
link bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
ln Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
logname Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
ls Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
mkdir Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
mkfifo Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
mknod Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
mktemp remove some unnecessary parentheses 2022-08-10 22:58:27 +02:00
more Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
mv Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
nice Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
nl Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
nohup Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
nproc Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
numfmt numfmt: implement Eq to fix clippy warning 2022-08-12 07:49:05 +02:00
od Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
paste Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
pathchk Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
pinky Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
pr Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
printenv Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
printf Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
ptx Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
pwd Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
readlink Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
realpath Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
relpath Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
rm Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
rmdir Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
runcon Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
seq Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
shred Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
shuf Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
sleep Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
sort Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
split Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
stat Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
stdbuf bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
sum Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
sync Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
tac Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
tail tail: fix race condition (#3798) 2022-08-14 01:01:15 +02:00
tee Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
test bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
timeout Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
touch touch: remove transmute to fix clippy warning 2022-08-12 10:54:59 +02:00
tr Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
true bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
truncate Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
tsort Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
tty Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
uname Add more consistency in the --help output and declarations 2022-08-04 21:53:27 +02:00
unexpand Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
uniq Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
unlink bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
uptime Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
users bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
vdir Replace deprecated is_present() with contains_id() 2022-08-02 15:21:39 +02:00
wc fix the significant_drop_in_scrutinee clippy warning 2022-08-10 21:37:48 +02:00
who Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00
whoami bump clap from 3.1.18 to 3.2.15 2022-07-29 14:05:02 +02:00
yes Replace deprecated values_of() with get_many() 2022-08-11 13:49:09 +02:00