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

From: Paul Tarjan <[email-masked]>
Date: Wed, 4 Mar 2026 11:17:45 -0700

On Tue, Mar 4, 2026, Patrick Steinhardt wrote:
> One thing that I'd be happy to learn about is why specifically you have
> chosen one second as a timeout value. Are we sure this is always enough
> on a loaded system?

The cookie round-trip (create temp file, get inotify event) is normally
a few milliseconds on a local filesystem, so 1 second gives plenty of
headroom. If it does fire on a heavily loaded box, the fallback is a
trivial (full-scan) response, same as any other error path, so the
user still gets correct results, just with a bit more work on their end.

Going much longer means the client just sits there waiting when
something is actually broken (like overlayfs not delivering events),
which is worse. Open to bumping it if you think 1s is too aggressive
though.