I ran into a bug similar to this one:
RHEL NFS client returns NULL bytes when reading a growing file
So my solution was to check for \0 Bytes and reread the file. Problem here is, that the wrong file, which includes the \0 Bytes, is cached on the system where the java application runs. So it takes quite a while to read the correct file contents.
When I do a sync && echo 2 > /proc/sys/vm/drop_caches
it immediately reads the correct content.
I tried to add sync
to the NFS mount options without a difference.
Is it possible to disable the file cache for a specific mount point? If so, how to do that?