Re: [PATCH v7 04/10] fsmonitor: use pthread_cond_timedwait for cookie wait
- From
- Paul Tarjan <paul@paultarjan.com>
- Date
- Mar 4, 2026, 18:17 UTC
- Message-ID
- <20260304181745.25673-1-github@paulisageek.com>
- In-Reply-To
- <aafifU-befdZW4O0@pks.im>
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.