Opened 2 years ago

Last modified 2 years ago

#66067 assigned defect

enabling git fsmonitor causes base to hang on git operations

Reported by: cjones051073 (Chris Jones) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.8.0
Keywords: Cc: jmroot (Joshua Root)
Port:

Description (last modified by cjones051073 (Chris Jones))

There is an issue with the latest base release, 2.8.0, not present with 2.7.x that causes base to hang if the user has

a) Set their ports tree to be a git clone and

b) Enabled the fsmonitor feature of recent git versions.

The feature is available since git 2.37

https://github.blog/2022-06-27-highlights-from-git-2-37/#a-builtin-filesystem-monitor-for-windows-and-macos

Enabling it just requires running

 > git config core.fsmonitor true 

When this is done, and if a) above is satisfied commands like port sync hang up just after the git command spawned completes

Oberon ~/Projects/MacPorts/ports > sudo port -d sync
DEBUG: Copying /Users/chris/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
--->  Updating the ports tree
Synchronizing local ports tree from file:///Users/chris/Projects/MacPorts/ports
DEBUG: euid/egid changed to: 501/20, env: HOME=/Users/chris
DEBUG: /opt/local/bin/git pull --rebase --autostash
DEBUG: system -W /Users/chris/Projects/MacPorts/ports: /opt/local/bin/git pull --rebase --autostash
Already up to date.
<hangup> 

If, during this hangup, I check the processes running I see this one

67138 s010  S+     0:00.01 /opt/local/libexec/git-core/git fsmonitor--daemon run --detach --ipc-threads=8

and indeed if I manually kill that process the port sync command continues.

So... A simple reproducer for the issue is the following

  1. Configure your macports installation to use a git clone of the ports tree in your personal user area, instead of the default tarball approach. In my case this is under /Users/chris/Projects/MacPorts/ports.
  1. Install macports git

sudo port install git

  1. Enable the fs monitor for the ports tree checkout you made in 1.

cd /Users/chris/Projects/MacPorts/ports git config core.fsmonitor true

  1. run 'port -d sync'

My guess from the above is port is waiting for the git command it spawned to complete, but isn't handling correctly the fact that with the fsmonitor option enabled git could spawn a sub-process that remains running after the command that spawned it completes.

This was not an issue with the previous 2.7.x releases, so appears to be an issue new to 2.8.0.

Change History (1)

comment:1 Changed 2 years ago by cjones051073 (Chris Jones)

Description: modified (diff)
Note: See TracTickets for help on using tickets.