Skip to content

Commit 041afb4

Browse files
Merge pull request git-for-windows#437 from jeffhostetler/gvfs-try-v4-fsmonitor-take2
Replace pre-V4 of FSMonitor with V4 using GFW experimental commits
2 parents d1c91db + e4dcae6 commit 041afb4

31 files changed

+1505
-609
lines changed

Documentation/technical/api-trace2.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,46 @@ stopping after the waitpid() and includes OS process creation overhead).
599599
So this time will be slightly larger than the atexit time reported by
600600
the child process itself.
601601

602+
`"child_ready"`::
603+
This event is generated after the current process has started
604+
a background process and released all handles to it.
605+
+
606+
------------
607+
{
608+
"event":"child_ready",
609+
...
610+
"child_id":2,
611+
"pid":14708, # child PID
612+
"ready":"ready", # child ready state
613+
"t_rel":0.110605 # observed run-time of child process
614+
}
615+
------------
616+
+
617+
Note that the session-id of the child process is not available to
618+
the current/spawning process, so the child's PID is reported here as
619+
a hint for post-processing. (But it is only a hint because the child
620+
process may be a shell script which doesn't have a session-id.)
621+
+
622+
This event is generated after the child is started in the background
623+
and given a little time to boot up and start working. If the child
624+
startups normally and while the parent is still waiting, the "ready"
625+
field will have the value "ready".
626+
If the child is too slow to start and the parent times out, the field
627+
will have the value "timeout".
628+
If the child starts but the parent is unable to probe it, the field
629+
will have the value "error".
630+
+
631+
After the parent process emits this event, it will release all of its
632+
handles to the child process and treat the child as a background
633+
daemon. So even if the child does eventually finish booting up,
634+
the parent will not emit an updated event.
635+
+
636+
Note that the `t_rel` field contains the observed run time in seconds
637+
when the parent released the child process into the background.
638+
The child is assumed to be a long-running daemon process and may
639+
outlive the parent process. So the parent's child event times should
640+
not be compared to the child's atexit times.
641+
602642
`"exec"`::
603643
This event is generated before git attempts to `exec()`
604644
another command rather than starting a child process.

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,9 @@ all::
473473
#
474474
# If your platform supports a built-in fsmonitor backend, set
475475
# FSMONITOR_DAEMON_BACKEND to the "<name>" of the corresponding
476-
# `compat/fsmonitor/fsm-listen-<name>.c` that implements the
477-
# `fsm_listen__*()` routines.
476+
# `compat/fsmonitor/fsm-listen-<name>.c` and
477+
# `compat/fsmonitor/fsm-health-<name>.c` files
478+
# that implement the `fsm_listen__*()` and `fsm_health__*()` routines.
478479
#
479480
# If your platform has os-specific ways to tell if a repo is incompatible with
480481
# fsmonitor (whether the hook or ipc daemon version), set FSMONITOR_OS_SETTINGS
@@ -1963,6 +1964,7 @@ endif
19631964
ifdef FSMONITOR_DAEMON_BACKEND
19641965
COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND
19651966
COMPAT_OBJS += compat/fsmonitor/fsm-listen-$(FSMONITOR_DAEMON_BACKEND).o
1967+
COMPAT_OBJS += compat/fsmonitor/fsm-health-$(FSMONITOR_DAEMON_BACKEND).o
19661968
endif
19671969

19681970
ifdef FSMONITOR_OS_SETTINGS

0 commit comments

Comments
 (0)