diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2022-03-25 18:03:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-25 16:04:17 -0700 |
commit | b05880d357c6dadba8d1d7943f4782fc25e06999 (patch) | |
tree | 47cf5937ecd1f6c2e260a7fdc0a9f4e052bd6b9c /t | |
parent | fsmonitor--daemon: periodically truncate list of modified files (diff) | |
download | tgif-b05880d357c6dadba8d1d7943f4782fc25e06999.tar.xz |
fsmonitor--daemon: use a cookie file to sync with file system
Teach fsmonitor--daemon client threads to create a cookie file
inside the .git directory and then wait until FS events for the
cookie are observed by the FS listener thread.
This helps address the racy nature of file system events by
blocking the client response until the kernel has drained any
event backlog.
This is especially important on MacOS where kernel events are
only issued with a limited frequency. See the `latency` argument
of `FSeventStreamCreate()`. The kernel only signals every `latency`
seconds, but does not guarantee that the kernel queue is completely
drained, so we may have to wait more than one interval. If we
increase the latency, the system is more likely to drop events.
We avoid these issues by having each client thread create a unique
cookie file and then wait until it is seen in the event stream.
Co-authored-by: Kevin Willford <Kevin.Willford@microsoft.com>
Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
0 files changed, 0 insertions, 0 deletions