coreutils
[Top][All Lists]
Advanced

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

Re: tail is reading already rotated file.


From: Pádraig Brady
Subject: Re: tail is reading already rotated file.
Date: Fri, 06 Feb 2015 10:28:38 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 06/02/15 03:36, Bernhard Voelker wrote:

>> diff --git a/tests/tail-2/inotify-rotate-resources.sh 
>> b/tests/tail-2/inotify-rotate-resources.sh

>> +# Normally less than a second is required here, but with heavy load
>> +# and a lot of disk activity, even 20 seconds is insufficient, which
>> +# leads to this timeout killing tail before processing is completed.
>> +touch k || framework_failure_
>> +timeout 500 strace -e inotify_rm_watch -o strace.out tail -F k >> out 2>&1 &
>> +pid=$!
> 
> 500s = 8min 20s ... sounds much.
> 
>> +
>> +for i in $(seq 6); do

Yep. I originally went many times around the loop with smaller timeouts,
but since we're waiting for completion here, twice around the loop is fine,
in which case 180 is fine for this safety net timeout to cleanup stray tail 
processes.

>> +    # truncate files (opened O_APPEND above)
>> +    >out && >strace.out || framework_failure_ 'failed to reset output files'
> 
> strace.out isn't opened with O_APPEND, so at least the comment is misleading.

O_APPEND doesn't actually impact this test (as any preceeding NULs in 
strace.out insignificant).
Anyway since now only going round the loop twice this won't happen. So I just 
removed comment.

>> diff --git a/tests/tail-2/retry.sh b/tests/tail-2/retry.sh
>> +cp out /tmp/pb.tail
> 
> oops! A remainder from debugging.

Heh, good spot.

> Should we add another test for "chmod -r/chmod +r"ed files?

We'll be adding more changes/tests in that area for http://bugs.gnu.org/19765

thanks!
Pádraig.




reply via email to

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