Re: [PATCH v6 04/10] fsmonitor: use pthread_cond_timedwait for cookie wait
- From
- Paul Tarjan <paul@paultarjan.com>
- Date
- Feb 27, 2026, 06:31 UTC
- Message-ID
- <20260227063118.9069-1-github@paulisageek.com>
- In-Reply-To
- <xmqqzf4w8r20.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 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