Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored directories are still processed #501

Open
rfay opened this issue Jun 7, 2024 · 0 comments
Open

Ignored directories are still processed #501

rfay opened this issue Jun 7, 2024 · 0 comments

Comments

@rfay
Copy link
Contributor

rfay commented Jun 7, 2024

DDEV has been very successful in using mutagen, and people love it. Thanks!

DDEV currently uses mutagen 0.17.2, and the classic environment is macOS filesystem as the alpha, and a docker container as the beta, actually syncing to a mounted docker volume.

In exploring a user's issues with polling inside the container, ddev/ddev#6286

I happened to discover behavior that was unexpected. I was using the ddev mutagen logs feature, which wraps mutagen daemon run with MUTAGEN_LOG_LEVEL=trace and I notice that files in ignored directories still cause mutagen to do things.

The key example is the .git directory of the project. I happened to do a git status on the host (alpha) and I see
2024-06-07 10:37:16.294341 [T] [sync.sync_06rS9JYw.alpha.watching] Processing event path: ".git/index.lock"

Further exploration showed that all git activities were monitored on the alpha.

Here's the description of the sync session:

Sync session in use
Mutagen: ok: 
--------------------------------------------------------------------------------
Name: d10
Identifier: sync_06rS9JYwiPlTvWhjUa9uBI9QctzRcdhAY2GQus9NlqC
Labels:
	com.ddev.config-hash: 70e61639ed0eb44cf5ff2c0010e6f0b827b42c30
	com.ddev.volume-signature: Users-rfay-lima-default-sock-1717777961
Configuration:
	Synchronization mode: Two Way Resolved
	Hashing algorithm: Default (SHA-1)
	Maximum allowed entry count: Default (2⁶⁴−1)
	Maximum staging file size: Default (18 EB)
	Symbolic link mode: POSIX Raw
	Ignore VCS mode: Default (Propagate)
	Ignores:
		/.git
		/.tarballs
		/.ddev/db_snapshots
		/.ddev/.importdb*
		.DS_Store
		.idea
		/web/sites/default/files
	Permissions mode: Default (Portable)
Alpha:
	URL: /Users/rfay/workspace/d10
	Configuration:
		Watch mode: Default (Portable)
		Watch polling interval: Default (10 seconds)
		Probe mode: Default (Probe)
		Scan mode: Default (Accelerated)
		Stage mode: Neighboring
		File mode: Default (0600)
		Directory mode: Default (0700)
		Default file/directory owner: Default
		Default file/directory group: Default
	Connected: Yes
	Synchronizable contents:
		7160 directories
		27681 files (136 MB)
		4 symbolic links
Beta:
	URL: docker://ddev-d10-web/var/www/html
		DOCKER_HOST=unix:///Users/rfay/.lima/default/sock/docker.sock
	Configuration:
		Watch mode: Default (Portable)
		Watch polling interval: Default (10 seconds)
		Probe mode: Default (Probe)
		Scan mode: Default (Accelerated)
		Stage mode: Neighboring
		File mode: Default (0600)
		Directory mode: Default (0700)
		Default file/directory owner: Default
		Default file/directory group: Default
		Compression: Default (DEFLATE)
	Connected: Yes
	Synchronizable contents:
		7160 directories
		27681 files (136 MB)
		4 symbolic links
Status: Watching for changes
--------------------------------------------------------------------------------

Here's the mutagen.yml:

mutagen.yml contents
#ddev-generated
# To override this file remove the line above
# and add your own configuration. If you override it you will
# probably want to check it in.
# Please do `ddev mutagen reset` after changing the file.
# See DDEV Mutagen docs at
# https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen
# For detailed information about mutagen configuration options, see
# https://mutagen.io/documentation/introduction/configuration
sync:
  defaults:
    mode: "two-way-resolved"
    stageMode: "neighboring"
    ignore:
      paths:
        # The top-level .git directory is ignored because where possible it's
        # mounted into the container with a traditional docker bind-mount
        - "/.git"
        - "/.tarballs"
        - "/.ddev/db_snapshots"
        - "/.ddev/.importdb*"
        - ".DS_Store"
        - ".idea"
        - "/web/sites/default/files"

        # You can also exclude other directories from mutagen-syncing
        # For example /var/www/html/var does not need to sync in TYPO3
        # so you can add:
        # - "/var"
        # vcs like .git can be ignored for safety, but then some
        # composer operations may fail if they use dev versions/git.
        # vcs: true
    symlink:
      mode: "posix-raw"

Trace content from git status:

Related trace content of git status
2024-06-07 10:42:13.734636 [T] [sync.sync_06rS9JYw.alpha.watching] Processing event path: ".git/index.lock"
2024-06-07 10:42:13.755793 [D] [sync.sync_06rS9JYw] Triggered by alpha endpoint
2024-06-07 10:42:13.757442 [D] [sync.sync_06rS9JYw] Scanning endpoints
2024-06-07 10:42:13.757498 [D] [sync.sync_06rS9JYw.beta] Using last snapshot bytes as baseline
2024-06-07 10:42:13.757500 [D] [sync.sync_06rS9JYw.alpha] Performing accelerated scan with 1 recheck paths
2024-06-07 16:42:13.773050 [D] [sync.sync_06rS9JYw.beta] Performing accelerated scan with existing snapshot
2024-06-07 10:42:13.777443 [D] [sync.sync_06rS9JYw.alpha] Saving cache to disk
2024-06-07 10:42:13.781882 [D] [sync.sync_06rS9JYw.beta] Snapshot delta yielded 1552043 bytes using 1 block operation(s) and 0 data operation(s) totaling 0 byte(s)
2024-06-07 10:42:13.802882 [T] [sync.sync_06rS9JYw] Ancestor contains 34845 entries, alpha contains 34845 entries, beta contains 34845 entries
2024-06-07 10:42:13.809974 [D] [sync.sync_06rS9JYw] Performing reconciliation
2024-06-07 10:42:13.894223 [T] [sync.sync_06rS9JYw.alpha.watching] Processing event path: ".git/index.lock"
2024-06-07 10:42:13.915310 [D] [sync.sync_06rS9JYw] Triggered by alpha endpoint
2024-06-07 10:42:13.916726 [D] [sync.sync_06rS9JYw] Scanning endpoints
2024-06-07 10:42:13.916761 [D] [sync.sync_06rS9JYw.beta] Using last snapshot bytes as baseline
2024-06-07 10:42:13.916775 [D] [sync.sync_06rS9JYw.alpha] Performing accelerated scan with 1 recheck paths
2024-06-07 16:42:13.932496 [D] [sync.sync_06rS9JYw.beta] Performing accelerated scan with existing snapshot
2024-06-07 10:42:13.943909 [D] [sync.sync_06rS9JYw.beta] Snapshot delta yielded 1552043 bytes using 1 block operation(s) and 0 data operation(s) totaling 0 byte(s)
2024-06-07 10:42:13.964937 [T] [sync.sync_06rS9JYw] Ancestor contains 34845 entries, alpha contains 34845 entries, beta contains 34845 entries
2024-06-07 10:42:13.971238 [D] [sync.sync_06rS9JYw] Performing reconciliation
2024-06-07 16:42:16.468898 [D] [sync.sync_06rS9JYw.beta] [polling] Received timer-based polling signal
2024-06-07 16:42:16.469037 [D] [sync.sync_06rS9JYw.beta] [polling] Performing filesystem scan
2024-06-07 16:42:16.603449 [D] [sync.sync_06rS9JYw.beta] [polling] Accelerated scanning now available
2024-06-07 16:42:16.614291 [D] [sync.sync_06rS9JYw.beta] [polling] No unignored modifications detected

Does the alpha actually monitor things and ignore them? Is that what's going on here? It seems like unexpected work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant