fix(doctor): avoid slow filepath.Walk on Docker bind mounts#3299
Merged
steveyegge merged 3 commits intogastownhall:mainfrom Mar 27, 2026
Merged
fix(doctor): avoid slow filepath.Walk on Docker bind mounts#3299steveyegge merged 3 commits intogastownhall:mainfrom
steveyegge merged 3 commits intogastownhall:mainfrom
Conversation
…lt-port check filepath.Walk over the entire town root takes 2+ minutes on Docker bind mounts (macOS VirtioFS) due to per-entry host roundtrips. Port files only exist in predictable .beads directories, so enumerate those directly using the same rig discovery pattern as findMetadataFiles. Co-Authored-By: Claude
filepath.Walk over the entire town root takes 2+ minutes on Docker bind mounts (macOS VirtioFS) due to 180k+ files in Dolt storage and git objects. Skip these directories since they never contain agent locks. Co-Authored-By: Claude
…l-server-info check Same fix pattern as stale-dolt-port: enumerate known .beads/dolt/.dolt/ locations via rigs.json + top-level directory scan instead of walking the entire town root. Eliminates ~40s of IO on Docker bind mounts (macOS VirtioFS) with 180k+ files. Co-Authored-By: Claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I've found that
gt doctorhangs for minutes on Docker bind mounts (macOS VirtioFS) because three code paths usefilepath.Walkover the entire town root. This PR replaces all three with targeted lookups.Note: I'm fairly new to Gas Town - the Claude-based reasoning on why it's reasonable to filter the paths walked seems plausible but is the point of least certainty for me.
I fully appreciate this might not be the correct fix, but Gas Town running in docker compose is obviously new-ish (to this repo at least) and this fix really does improve things a lot.
Details
Symptom:
gt doctortakes 2+ minutes on Docker containers using macOS VirtioFS bind mounts where the town root contains 180k+ files across nested git repos. This has the appearance of having frozen but it turns out does eventually complete, after a lot of really slow IO!Root cause: Three
filepath.Walkcalls traverse the full directory tree. The git directories I could observe contained ~180k+ objects — VirtioFS stat() calls are orders of magnitude slower than native filesystem, so walking these trees dominates runtime.findPortFilesinstale_dolt_port_check.go— walks the entire town root to finddolt-server.portfiles. Replaced with known-path enumeration usingrigs.json, matching the existingfindMetadataFilespattern.FindAllLocksinlock.go— walks the full tree to findagent.lockfiles. Addedfilepath.SkipDirfor.dolt-data,.dolt-backup, and.gitdirectories which never contain agent locks.StaleSQLServerInfoCheck.Runinstale_sql_server_info_check.go— walks the entire town root to findsql-server.infofiles inside.doltdirectories. Replaced with known-path enumeration usingrigs.json+ top-level directory scan fallback.Verification
gt doctoris now completing in seconds instead of minutes inside Docker containers with VirtioFS bind mounts.