Re: fsmonitor on linux is triggered due to unison changes its fingerprint cache

"'Dale R. Worley' via unison-users" <[email protected]> Thu, 25 Sep 2025 22:35:39 -0400
Newsgroups gmane.network.unison.general
Message-ID <[email protected]>
[send send attempt]

Ulrich Gemkow <[email protected]> writes:
> On Sunday 21 September 2025, Dale R. Worley wrote:
>> My understanding of all this is weak, but I notice an oddity in this bug
>> report that nobody else seems to have commented on:
>> 
>> Ulrich Gemkow <[email protected]> writes:
>> > The inotify watch tool shows this sequence about every second:
>> >
>> > # ~/.unison/homesync/ OPEN fpd51d53afbd71ea49fcec7a981a36e25f
>> > # ~/.unison/homesync/ ACCESS fpd51d53afbd71ea49fcec7a981a36e25f
>> > # ~/.unison/homesync/ CLOSE_NOWRITE,CLOSE fpd51d53afbd71ea49fcec7a981a36e25f
>> > # ~/.unison/homesync/ OPEN fpd51d53afbd71ea49fcec7a981a36e25f
>> > # ~/.unison/homesync/ MODIFY fpd51d53afbd71ea49fcec7a981a36e25f
>> > # ~/.unison/homesync/ CLOSE_WRITE,CLOSE fpd51d53afbd71ea49fcec7a981a36e25f
>> 
>> That line that says "MODIFY" -- what is being modified and who is
>> modifying it?  Your report says that nothing has been changed in the
>> actual user files and that Unison makes no changes.
>
> This is the output of a tool which uses the Linux inotify syscall to
> watch for changes in a directory tree. It tells that the file named
> at the end of the line is modified ((fpd51d53afbd71ea49fcec7a981a36e25f).
>
> This is unisons fingerprint file.

Ah!  I had assumed that "fpd51d53afbd71ea49fcec7a981a36e25f" was some
sort of internal code.

The let me propose this sequence of events:

1. Unison wakes up and runs.
2. No files have changed, so it doesn't do anything.
3. Unison does not change the contents of fpNNNNNNNN but it updates its
modification date.
4. Unison sleeps.
5. fsmonitor is notified that the modification date of fpNNNNNNNN has
changed.
6. fsmonitor wakes up Unison.
7. Unison wakes up and runs.
etc.

What we need for this situation is that if Unison detects no changes, it
should not modify the file system, not even the files in ~/.unison.  In
particular, it should not change the fp* file if it does not change its
contents.

Dale

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].