[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils
Subject:    Re: tail is reading already rotated file.
From:       Pádraig Brady <P () draigBrady ! com>
Date:       2015-02-06 10:28:38
Message-ID: 54D49756.4080402 () draigBrady ! com
[Download RAW message or body]

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.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic