Subject: Re: [PATCH v6 04/10] fsmonitor: use pthread_cond_timedwait for cookie wait

From: Paul Tarjan <[email-masked]>
Date: Thu, 26 Feb 2026 23:31:18 -0700

Junio C Hamano <[email-masked]> writes:

> I cannot convince myself if one-second interval is not too frequent
> to force everybody, including those with working inotify, to poll.
> I wonder if this is something that may want to be configurable (or
> better yet, auto-detectable, but that may be wishing for moon).

The 1-second timeout only fires when the filesystem fails to deliver
the cookie event at all (e.g. overlayfs in containers where inotify
watches succeed but events never arrive). On a working filesystem
the cookie event comes back in well under a millisecond, so the
timeout never triggers. When it does fire, the client falls back to
a full scan, which is the safe default. Happy to make it
configurable if you think that's worth it, but the current behavior
seemed reasonable as a starting point.

Thanks,
Paul