Discussion:
bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
(too old to reply)
Jewsco Pius Jacquez
2018-04-16 17:11:21 UTC
Permalink
Hello,

We have a legacy application that is using tail -f command in the application and is running in Redhat 9 under a shared Samba filesystem.

We want to migrate the application to RHEL7 and we noticed that the tail -f command here is not refreshing as soon as the file get changed. In Redhat 9, it is working fine, every write on the file got reflected straight away(no waiting interval).

Is there a way that we can make the tail -f working as it was in Redhat 9? For this reason, we are not able to migrate our Legacy application.

Thanks,
Jewsco
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Pádraig Brady
2018-04-17 07:29:18 UTC
Permalink
Post by Jewsco Pius Jacquez
Hello,
We have a legacy application that is using tail -f command in the application and is running in Redhat 9 under a shared Samba filesystem.
We want to migrate the application to RHEL7 and we noticed that the tail -f command here is not refreshing as soon as the file get changed. In Redhat 9, it is working fine, every write on the file got reflected straight away(no waiting interval).
Is there a way that we can make the tail -f working as it was in Redhat 9? For this reason, we are not able to migrate our Legacy application.
To get around the issue, the undocumented ---disable-inotify option may help
(note the three dashes)

If that does help then there is an issue with the misdetection
of a known file system as local, when it should be treated as remote.
Can you show the file system type for the file you're trying to tail, using:

stat -f -c '%t %T' /path/to/your/file

cheers,
Pádraig
Jewsco Pius Jacquez
2018-04-17 15:46:27 UTC
Permalink
Padraig, thanks for your response,

The ---disable-inotify didn't refresh either.

[***@cmilsbtest03 ~]# stat -f -c '%t %T' /media/samba/test.file
ff534d42 cifs
[***@cmilsbtest03 ~]# df -h /media/samba/test.file
Filesystem Size Used Avail Use% Mounted on
//10.124.61.52/finance
14G 13G 1.6G 89% /media/samba
[***@cmilsbtest03 ~]# grep /media/samba /proc/mounts
//10.124.61.52/finance/ /media/samba cifs rw,relatime,sec=ntlm,cache=loose,unc=\134\13410.124.61.52\134finance,username=,uid=0,noforceuid,gid=0,noforcegid,addr=10.124.61.52,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,echo_interval=60,actimeo=1 0 0
[***@cmilsbtest03 ~]#


Thanks,
Jewsco


-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Tuesday, April 17, 2018 2:29 AM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Hello,
We have a legacy application that is using tail -f command in the application and is running in Redhat 9 under a shared Samba filesystem.
We want to migrate the application to RHEL7 and we noticed that the tail -f command here is not refreshing as soon as the file get changed. In Redhat 9, it is working fine, every write on the file got reflected straight away(no waiting interval).
Is there a way that we can make the tail -f working as it was in Redhat 9? For this reason, we are not able to migrate our Legacy application.
To get around the issue, the undocumented ---disable-inotify option may help (note the three dashes)

If that does help then there is an issue with the misdetection of a known file system as local, when it should be treated as remote.
Can you show the file system type for the file you're trying to tail, using:

stat -f -c '%t %T' /path/to/your/file

cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Erik Auerswald
2018-04-17 16:06:21 UTC
Permalink
Hi Jewsco,

did you already try the -F option instead of -f?

Thanks,
Erik
Post by Jewsco Pius Jacquez
Padraig, thanks for your response,
The ---disable-inotify didn't refresh either.
ff534d42 cifs
Filesystem Size Used Avail Use% Mounted on
//10.124.61.52/finance
14G 13G 1.6G 89% /media/samba
//10.124.61.52/finance/ /media/samba cifs rw,relatime,sec=ntlm,cache=loose,unc=\134\13410.124.61.52\134finance,username=,uid=0,noforceuid,gid=0,noforcegid,addr=10.124.61.52,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,echo_interval=60,actimeo=1 0 0
Thanks,
Jewsco
-----Original Message-----
Sent: Tuesday, April 17, 2018 2:29 AM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Hello,
We have a legacy application that is using tail -f command in the application and is running in Redhat 9 under a shared Samba filesystem.
We want to migrate the application to RHEL7 and we noticed that the tail -f command here is not refreshing as soon as the file get changed. In Redhat 9, it is working fine, every write on the file got reflected straight away(no waiting interval).
Is there a way that we can make the tail -f working as it was in Redhat 9? For this reason, we are not able to migrate our Legacy application.
To get around the issue, the undocumented ---disable-inotify option may help (note the three dashes)
If that does help then there is an issue with the misdetection of a known file system as local, when it should be treated as remote.
stat -f -c '%t %T' /path/to/your/file
cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Jewsco Pius Jacquez
2018-04-17 18:18:39 UTC
Permalink
Yes, it didn't work either.

The closest is this one(below), but still the update is every second only.
# tail --follow=name --max-unchanged-stats=1 --sleep-interval=1 /media/samba/test.file


Thanks,
Jewsco

-----Original Message-----
From: Erik Auerswald [mailto:***@unix-ag.uni-kl.de]
Sent: Tuesday, April 17, 2018 11:06 AM
To: Jewsco Pius Jacquez <***@Amdocs.com>
Cc: Pádraig Brady <***@draigBrady.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.

Hi Jewsco,

did you already try the -F option instead of -f?

Thanks,
Erik
Post by Jewsco Pius Jacquez
Padraig, thanks for your response,
The ---disable-inotify didn't refresh either.
ff534d42 cifs
Filesystem Size Used Avail Use% Mounted on
//10.124.61.52/finance
14G 13G 1.6G 89% /media/samba
//10.124.61.52/finance/ /media/samba cifs
rw,relatime,sec=ntlm,cache=loose,unc=\134\13410.124.61.52\134finance,u
sername=,uid=0,noforceuid,gid=0,noforcegid,addr=10.124.61.52,unix,posi
xpaths,serverino,acl,rsize=1048576,wsize=65536,echo_interval=60,actime
o=1 0 0
Thanks,
Jewsco
-----Original Message-----
Sent: Tuesday, April 17, 2018 2:29 AM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Hello,
We have a legacy application that is using tail -f command in the application and is running in Redhat 9 under a shared Samba filesystem.
We want to migrate the application to RHEL7 and we noticed that the tail -f command here is not refreshing as soon as the file get changed. In Redhat 9, it is working fine, every write on the file got reflected straight away(no waiting interval).
Is there a way that we can make the tail -f working as it was in Redhat 9? For this reason, we are not able to migrate our Legacy application.
To get around the issue, the undocumented ---disable-inotify option
may help (note the three dashes)
If that does help then there is an issue with the misdetection of a known file system as local, when it should be treated as remote.
stat -f -c '%t %T' /path/to/your/file
cheers,
Pádraig
This message and the information contained herein is proprietary and
confidential and subject to the Amdocs policy statement,
you may review at https://www.amdocs.com/about/email-disclaimer
<https://www.amdocs.com/about/email-disclaimer>
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Bernhard Voelker
2018-04-18 06:39:19 UTC
Permalink
Post by Jewsco Pius Jacquez
Yes, it didn't work either.
The closest is this one(below), but still the update is every second only.
# tail --follow=name --max-unchanged-stats=1 --sleep-interval=1 /media/samba/test.file
The --sleep-interval option not only accepts integers: see info:

When using tail without inotify support, you can make
it more responsive by using a sub-second sleep interval, e.g., via
an alias like this:

alias tail='tail -s.1'
Post by Jewsco Pius Jacquez
Post by Jewsco Pius Jacquez
ff534d42 cifs
But as tail(1) treats CIFS as "remote" [1], there may be some other
effect, e.g. buffering on the CIFS server or on the server writing
to that file. Are you sure data is available more often?

[1]
https://git.sv.gnu.org/cgit/coreutils.git/tree/src/stat.c?id=e6017741e9#n301

Have a nice day,
Berny
Pádraig Brady
2018-04-19 03:03:53 UTC
Permalink
Could you clarify whether the rhel7 version of tail
is too slow when showing updates to the file,
or misses updates to the file entirely.

There have been various fixes to tail, so it
would be worth verifying how the latest behaves, like:

wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
cd coreutils-8.29
./configure --quiet && make -j$(nproc)
src/tail -f /media/samba/test.file

cheers,
Pádraig
Jewsco Pius Jacquez
2018-04-19 14:43:07 UTC
Permalink
Pádraig, thanks for your response.

In my reproducer environment, it doesn't totally update. RHEL7 Samba server, RHEL6 Samba client.

Unless I provided the extra interval parameter.

When I run it in Redhat9, I don't need any extra, it refresh automatically.


[***@cmilsbtest03 src]$ ./tail --version
tail (GNU coreutils) 8.29
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
and Jim Meyering.
[***@cmilsbtest03 src]$ date; time ./tail -f /media/samba/test.file
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:47 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018
Thu Apr 19 09:28:48 CDT 2018


^C
real 10m51.467s
user 0m0.009s
sys 0m0.006s

[***@cmilsbtest03 src]$ date; time ./tail -f /media/samba/test.file
Thu Apr 19 09:39:42 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:38 CDT 2018
Thu Apr 19 09:39:39 CDT 2018
Thu Apr 19 09:39:39 CDT 2018
^C
real 0m3.908s
user 0m0.000s
sys 0m0.001s

[***@cmilsbtest03 src]$

-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Wednesday, April 18, 2018 10:04 PM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.

Could you clarify whether the rhel7 version of tail is too slow when showing updates to the file, or misses updates to the file entirely.

There have been various fixes to tail, so it would be worth verifying how the latest behaves, like:

wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
cd coreutils-8.29
./configure --quiet && make -j$(nproc)
src/tail -f /media/samba/test.file

cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Pádraig Brady
2018-05-02 07:45:49 UTC
Permalink
Post by Jewsco Pius Jacquez
Pádraig, thanks for your response.
In my reproducer environment, it doesn't totally update. RHEL7 Samba server, RHEL6 Samba client.
Unless I provided the extra interval parameter.
You said you used: tail --follow=name --max-unchanged-stats=1 --sleep-interval=1

The --sleep-interval=1 having a difference is confusing
as that already defaults to one second.
Also --max-unchanged-stats=1 should only make things more responsive.
I would have expected only --follow=name to have a significant
difference to the data that is eventually output.

Anyway there may be an issue with st_size updating on your system.
I.E. if stat() didn't update st_size on this remote file
then a new change that protects against a related issue
on glusterfs may be impacting here. One could check that
by reverting the patch and rebuilding in your previous build dir like:

cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make

One might also check this externally to tail(1) by repeatedly running
the following and seeing does the number correlate with remote changes:

stat -c '%s' /media/samba/test.file

cheers,
Pádraig
Jewsco Pius Jacquez
2018-05-02 13:39:23 UTC
Permalink
I tried and the --follow=name doesn't refresh either. The stat output is changing.

[***@cmilsbtest03 ~]$ tail --follow=name /media/samba/test.file
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:55 CDT 2018
^C
[***@cmilsbtest03 ~]$ tail --follow=name /media/samba/test.file
append Wed May 2 08:36:01 CDT 2018
append Wed May 2 08:36:01 CDT 2018
append Wed May 2 08:36:01 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
^C
[***@cmilsbtest03 ~]$ while :; do stat -c '%s' /media/samba/test.file; sleep 1; done
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417


About the reverting the patch, so I need to download the source and patch it?

cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make



Thanks,
Jewsco



-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Wednesday, May 2, 2018 2:46 AM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Pádraig, thanks for your response.
In my reproducer environment, it doesn't totally update. RHEL7 Samba server, RHEL6 Samba client.
Unless I provided the extra interval parameter.
You said you used: tail --follow=name --max-unchanged-stats=1 --sleep-interval=1

The --sleep-interval=1 having a difference is confusing as that already defaults to one second.
Also --max-unchanged-stats=1 should only make things more responsive.
I would have expected only --follow=name to have a significant difference to the data that is eventually output.

Anyway there may be an issue with st_size updating on your system.
I.E. if stat() didn't update st_size on this remote file then a new change that protects against a related issue on glusterfs may be impacting here. One could check that by reverting the patch and rebuilding in your previous build dir like:

cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make

One might also check this externally to tail(1) by repeatedly running the following and seeing does the number correlate with remote changes:

stat -c '%s' /media/samba/test.file

cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Pádraig Brady
2018-05-04 01:47:21 UTC
Permalink
Post by Jewsco Pius Jacquez
I tried and the --follow=name doesn't refresh either. The stat output is changing.
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:54 CDT 2018
append Wed May 2 08:35:55 CDT 2018
^C
append Wed May 2 08:36:01 CDT 2018
append Wed May 2 08:36:01 CDT 2018
append Wed May 2 08:36:01 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
append Wed May 2 08:36:02 CDT 2018
^C
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417
About the reverting the patch, so I need to download the source and patch it?
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make
You'd done that previously, for for completeness
yes you need to download the source first like:

wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz

thanks,
Pádraig
Jewsco Pius Jacquez
2018-05-04 15:12:04 UTC
Permalink
Thanks, did I missed anything?

[***@cmilsbtest02 ~]$ wget --quiet https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
[***@cmilsbtest02 ~]$ cksum coreutils-8.29.tar.xz
926393761 5286588 coreutils-8.29.tar.xz
[***@cmilsbtest02 ~]$ tar -xf coreutils-8.29.tar.xz
[***@cmilsbtest02 ~]$ cd coreutils-8.29/
[***@cmilsbtest02 coreutils-8.29]$ wget --quiet 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- | patch -R -p1 && make
patching file NEWS
Unreversed patch detected! Ignore -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file NEWS.rej
patching file src/tail.c
Hunk #1 FAILED at 1220.
1 out of 1 hunk FAILED -- saving rejects to file src/tail.c.rej
[***@cmilsbtest02 coreutils-8.29]$



Thanks,
Jewsco





-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Thursday, May 3, 2018 8:47 PM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
I tried and the --follow=name doesn't refresh either. The stat output is changing.
append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT
2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54
CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2
08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:55 CDT 2018 ^C
append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:01 CDT
2018 append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:02
CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May 2
08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 ^C
/media/samba/test.file; sleep 1; done
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417
About the reverting the patch, so I need to download the source and patch it?
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make
You'd done that previously, for for completeness yes you need to download the source first like:

wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz

thanks,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Pádraig Brady
2018-05-05 22:52:19 UTC
Permalink
Post by Jewsco Pius Jacquez
Thanks, did I missed anything?
926393761 5286588 coreutils-8.29.tar.xz
patching file NEWS
Unreversed patch detected! Ignore -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file NEWS.rej
patching file src/tail.c
Hunk #1 FAILED at 1220.
1 out of 1 hunk FAILED -- saving rejects to file src/tail.c.rej
Thanks,
Jewsco
-----Original Message-----
Sent: Thursday, May 3, 2018 8:47 PM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
I tried and the --follow=name doesn't refresh either. The stat output is changing.
append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT
2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54
CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2
08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:55 CDT 2018 ^C
append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:01 CDT
2018 append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:02
CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May 2
08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 ^C
/media/samba/test.file; sleep 1; done
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417
About the reverting the patch, so I need to download the source and patch it?
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make
wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
Drats sorry. There were conflicting patches in the meantime.
You can tweak it like:

cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
sed 's/name,/false, name,/' |
patch -p1 -R -t &&
make

cheers,
Pádraig
Jewsco Pius Jacquez
2018-05-22 21:23:11 UTC
Permalink
Any more ideas?

Thanks,
Jewsco

-----Original Message-----
From: Jewsco Pius Jacquez
Sent: Tuesday, May 8, 2018 8:56 AM
To: 'Pádraig Brady' <***@draigBrady.com>; ***@debbugs.gnu.org
Subject: RE: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.

Thanks

Still the same, the -f doesn't refresh. it applies to CIFS and NFS filesystem. Is it something related on how the network filesystem was designed?

Thanks,
Jewsco

-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Saturday, May 5, 2018 5:52 PM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Thanks, did I missed anything?
https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
926393761 5286588 coreutils-8.29.tar.xz
'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 && make patching file NEWS Unreversed patch detected!
Ignore -R? [n] Apply anyway? [n] Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file NEWS.rej patching
file src/tail.c Hunk #1 FAILED at 1220.
1 out of 1 hunk FAILED -- saving rejects to file src/tail.c.rej
Thanks,
Jewsco
-----Original Message-----
Sent: Thursday, May 3, 2018 8:47 PM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
I tried and the --follow=name doesn't refresh either. The stat output is changing.
append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT
2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54
CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2
08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:55 CDT 2018 ^C
append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:01 CDT
2018 append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:02
CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May 2
08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 ^C
/media/samba/test.file; sleep 1; done
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417
About the reverting the patch, so I need to download the source and patch it?
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make
wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
Drats sorry. There were conflicting patches in the meantime.
You can tweak it like:

cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- | sed 's/name,/false, name,/' | patch -p1 -R -t && make

cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Pádraig Brady
2018-05-23 05:10:26 UTC
Permalink
Post by Jewsco Pius Jacquez
Any more ideas?
Thanks,
Jewsco
-----Original Message-----
From: Jewsco Pius Jacquez
Sent: Tuesday, May 8, 2018 8:56 AM
Subject: RE: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Thanks
Still the same, the -f doesn't refresh. it applies to CIFS and NFS filesystem. Is it something related on how the network filesystem was designed?
Thanks,
Jewsco
-----Original Message-----
Sent: Saturday, May 5, 2018 5:52 PM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Thanks, did I missed anything?
https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
926393761 5286588 coreutils-8.29.tar.xz
'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 && make patching file NEWS Unreversed patch detected!
Ignore -R? [n] Apply anyway? [n] Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file NEWS.rej patching
file src/tail.c Hunk #1 FAILED at 1220.
1 out of 1 hunk FAILED -- saving rejects to file src/tail.c.rej
Thanks,
Jewsco
-----Original Message-----
Sent: Thursday, May 3, 2018 8:47 PM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
I tried and the --follow=name doesn't refresh either. The stat output is changing.
append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT
2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54
CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2
08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:55 CDT 2018 ^C
append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:01 CDT
2018 append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:02
CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May 2
08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 ^C
/media/samba/test.file; sleep 1; done
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417
About the reverting the patch, so I need to download the source and patch it?
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make
wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
Drats sorry. There were conflicting patches in the meantime.
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- | sed 's/name,/false, name,/' | patch -p1 -R -t && make
cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,
Well I can't repro with 8.29 on nfs here.
Perhaps the read() is blocking or something.
It would be useful to get the output of:

strace -o tail.strace tail -f /media/samba/test.file

Also for completeness, it would be good to give
the command used to write to the file on the remote end.

thanks,
Pádraig
Jewsco Pius Jacquez
2018-06-12 15:10:35 UTC
Permalink
Padraig, thanks a lot for your help on this.

We found a workaround combined with cache=none mount option and it works for our customer. You can close this case.

tail --follow=name --max-unchanged-stats=1 --sleep-interval=.01 <filename>

thanks,
jewsco

-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Wednesday, May 23, 2018 12:10 AM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Any more ideas?
Thanks,
Jewsco
-----Original Message-----
From: Jewsco Pius Jacquez
Sent: Tuesday, May 8, 2018 8:56 AM
Subject: RE: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Thanks
Still the same, the -f doesn't refresh. it applies to CIFS and NFS filesystem. Is it something related on how the network filesystem was designed?
Thanks,
Jewsco
-----Original Message-----
Sent: Saturday, May 5, 2018 5:52 PM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
Thanks, did I missed anything?
https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
926393761 5286588 coreutils-8.29.tar.xz
'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 && make patching file NEWS Unreversed patch detected!
Ignore -R? [n] Apply anyway? [n] Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file NEWS.rej patching
file src/tail.c Hunk #1 FAILED at 1220.
1 out of 1 hunk FAILED -- saving rejects to file src/tail.c.rej
Thanks,
Jewsco
-----Original Message-----
Sent: Thursday, May 3, 2018 8:47 PM
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.
Post by Jewsco Pius Jacquez
I tried and the --follow=name doesn't refresh either. The stat output is changing.
append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT
2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2 08:35:54
CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May 2
08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:54 CDT 2018 append Wed May 2 08:35:54 CDT 2018 append Wed May
2 08:35:55 CDT 2018 ^C
append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:01 CDT
2018 append Wed May 2 08:36:01 CDT 2018 append Wed May 2 08:36:02
CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May 2
08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 append Wed May 2 08:36:02 CDT 2018 append Wed May
2 08:36:02 CDT 2018 ^C
/media/samba/test.file; sleep 1; done
1649717
1650077
1650401
1650761
1651121
1651445
1651769
1652093
1652417
About the reverting the patch, so I need to download the source and patch it?
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch' -O- |
patch -R -p1 &&
make
wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
Drats sorry. There were conflicting patches in the meantime.
cd coreutils-8.29 &&
wget 'https://github.com/coreutils/coreutils/commit/7fc7206.patch'
-O- | sed 's/name,/false, name,/' | patch -p1 -R -t && make
cheers,
Pádraig
This message and the information contained herein is proprietary and
confidential and subject to the Amdocs policy statement,
Well I can't repro with 8.29 on nfs here.
Perhaps the read() is blocking or something.
It would be useful to get the output of:

strace -o tail.strace tail -f /media/samba/test.file

Also for completeness, it would be good to give the command used to write to the file on the remote end.

thanks,
Pádraig

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Assaf Gordon
2018-10-30 03:07:19 UTC
Permalink
close 31184
stop
Post by Jewsco Pius Jacquez
Padraig, thanks a lot for your help on this.
We found a workaround combined with cache=none mount option and it works for our customer. You can close this case.
tail --follow=name --max-unchanged-stats=1 --sleep-interval=.01 <filename>
Given the above, I'm closing this bug.

-assaf

Jewsco Pius Jacquez
2018-04-30 21:09:38 UTC
Permalink
Pádraig, did you get a chance to look into this?

Thanks,
Jewsco

-----Original Message-----
From: Jewsco Pius Jacquez
Sent: Thursday, April 19, 2018 9:43 AM
To: 'Pádraig Brady' <***@draigBrady.com>; ***@debbugs.gnu.org
Subject: RE: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.

Pádraig, thanks for your response.

In my reproducer environment, it doesn't totally update. RHEL7 Samba server, RHEL6 Samba client.

Unless I provided the extra interval parameter.

When I run it in Redhat9, I don't need any extra, it refresh automatically.


[***@cmilsbtest03 src]$ ./tail --version tail (GNU coreutils) 8.29 Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering.
[***@cmilsbtest03 src]$ date; time ./tail -f /media/samba/test.file Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:47 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018 Thu Apr 19 09:28:48 CDT 2018


^C
real 10m51.467s
user 0m0.009s
sys 0m0.006s

[***@cmilsbtest03 src]$ date; time ./tail -f /media/samba/test.file Thu Apr 19 09:39:42 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:38 CDT 2018 Thu Apr 19 09:39:39 CDT 2018 Thu Apr 19 09:39:39 CDT 2018 ^C
real 0m3.908s
user 0m0.000s
sys 0m0.001s

[***@cmilsbtest03 src]$

-----Original Message-----
From: Pádraig Brady [mailto:***@draigBrady.com]
Sent: Wednesday, April 18, 2018 10:04 PM
To: Jewsco Pius Jacquez <***@Amdocs.com>; ***@debbugs.gnu.org
Subject: Re: bug#31184: tail -f on Network FS not refreshing as soon as the file is changed.

Could you clarify whether the rhel7 version of tail is too slow when showing updates to the file, or misses updates to the file entirely.

There have been various fixes to tail, so it would be worth verifying how the latest behaves, like:

wget https://ftpmirror.gnu.org/coreutils/coreutils-8.29.tar.xz
tar -xf coreutils-8.29.tar.xz
cd coreutils-8.29
./configure --quiet && make -j$(nproc)
src/tail -f /media/samba/test.file

cheers,
Pádraig
This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement,

you may review at https://www.amdocs.com/about/email-disclaimer <https://www.amdocs.com/about/email-disclaimer>
Loading...