Re: [PATCH] fsmonitor: flush pending FSEvents before cookie wait
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 4, 2026, 22:13 UTC
- Message-ID
- <xmqq4ih9ttyc.fsf@gitster.g>
- In-Reply-To
- <CAOTNsDy4pKbPHdK1T688Ax6Mgz15K-qfZR-8fAvTk48z3E43Rg@mail.gmail.com>
Koji Nakamaru <koji.nakamaru@gree.net> writes:
Show 18 quoted lines
> On Wed, Jul 22, 2026 at 6:05 AM Tamir Duberstein <tamird@gmail.com> wrote: >> >> 56cef9cb1a (fsmonitor: use pthread_cond_timedwait for cookie wait, >> 2026-04-15) limits the cookie wait to one second so that a filesystem >> which never delivers events cannot hang fsmonitor clients. A client that >> times out receives a trivial response and scans the entire index. >> >> FSEvents can defer delivery while it batches notifications and does not >> guarantee that its queue is drained in one latency interval. A loaded >> macOS system can therefore time out even though the event stream is >> working. >> ... > > This patch is carefully designed to minimize any risks. To drain events, > we could also call FSEventStreamFlushSync before acquiring main_lock in > do_handle_client(), but this patch should be sufficient if it mitigates > the issue. The commit message would be much more convincing if you also > included benchmark results showing how many timeouts were reduced.
Tamir, just to say that it is my understanding that the ball is in your court. It hasn't been _too_ long since the exchange happened, but we expect people to respond review comments (either positively or negatively) and without such discourse a topic would not move forward, so ...
Thanks.