diff options
author | Pádraig Brady <P@draigBrady.com> | 2009-10-01 08:36:25 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2009-10-02 14:00:06 +0100 |
commit | f8726e05c4ec1141fb3ffad1c9ec3838f59182cb (patch) | |
tree | 7153d27a45fb3d26b186473daf8443fc4654f377 /NEWS | |
parent | 95c01c656e061bccbab41fa651c99cb7041c9937 (diff) | |
download | coreutils-f8726e05c4ec1141fb3ffad1c9ec3838f59182cb.tar.xz |
tail: avoid a race where we could miss new data with --pid
* src/tail.c (tail_forever, tail_forever_inotify): Close a race in
tail_forever_inotify where new data written after the file check by
a now dead process, but before the pid check, is not output. We use
the POSIX guarantee that read() and write() are serialized wrt each
other even in separate processes, to assume full file consistency
after exit() and so poll for new data _after_ the writer has exited.
This also allows us to not redundantly _wait_ for new data if the
process is dead.
* tests/tail-2/pid: Remove the now partially invalid sub second sleep
check as we now don't unconditionally wait, and replace it with a check
for the redundant sleep. Also clarify some of the existing comments.
* NEWS: Mention the fix.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -22,6 +22,12 @@ GNU coreutils NEWS -*- outline -*- from a failed stat/lstat. For example ls -Lis now prints "?", not "0", for the inode number and allocated size of a dereferenced dangling symlink. + tail --follow --pid now avoids a race condition where data written + just before the process dies might not have been output by tail. + Also, tail no longer delays at all when the specified pid is not live. + [The race was introduced in coreutils-7.5, + and the unnecessary delay was present since textutils-1.22o] + ** Portability On Solaris 9, many commands would mistakenly treat file/ the same as |