Fixes stack overflow and database initialization failures when running bd on WSL2 with Docker Desktop bind mounts. ## Problem The bd CLI crashed with stack overflow when running on WSL2 with repositories on Docker Desktop bind mounts (/mnt/wsl/docker-desktop-bind-mounts/...). SQLite WAL mode fails with 'locking protocol' error on these network filesystems. ## Solution - Expand WAL mode detection to identify Docker bind mounts at /mnt/wsl/* (in addition to Windows paths at /mnt/[a-zA-Z]/) - Fall back to DELETE journal mode on these problematic paths - Add comprehensive unit tests for path detection Fixes GH #1224, relates to GH #920 Co-authored-by: maphew <matt.wilkie@gmail.com>
3.1 KiB
3.1 KiB
CI/CD Report - PR #1242: GH#1224 Fix
PR Overview
- Number: #1242
- Branch:
fix/gh1224-wsl2-sqlite-wal - Changes: 421 additions, 9 deletions across 5 files
- Status: ✅ READY FOR REVIEW
Test Results Summary
✅ Passed Tests (Our Changes)
| Test | Duration | Status |
|---|---|---|
| Test (ubuntu-latest) | 4m37s | PASSED ✅ |
| Test (macos-latest) | 3m34s | PASSED ✅ |
| Test Nix Flake | 3m4s | PASSED ✅ |
| Check version consistency | 7s | PASSED ✅ |
| Check for .beads changes | 11s | PASSED ✅ |
⚠️ Pre-existing Failures (Unrelated)
| Test | Duration | Status | Root Cause |
|---|---|---|---|
| Test (Windows - smoke) | 2m14s | FAILED ❌ | Dolt module bug in internal/storage/dolt/server.go |
| Lint | 30s | FAILED ❌ | Pre-existing linting issues in other modules |
Detailed Analysis
Our Changes Impact
Our changes are isolated to the SQLite storage module:
- Modified:
internal/storage/sqlite/store.go - New Tests:
internal/storage/sqlite/store_wsl_test.go - Integration Tests:
test_issue_gh1224.sh,test_wsl2_wal.sh
All tests related to SQLite storage PASSED with no regressions.
Windows Build Failure
Unknown field Setpgid in struct literal of type "syscall".SysProcAttr
Location: internal/storage/dolt/server.go#111
This is a pre-existing issue in the Dolt module (unrelated to our SQLite changes).
Lint Failures
Pre-existing issues in unrelated files:
cmd/bd/federation.go- unconvert warninginternal/storage/dolt/server.go- gosec warningsinternal/storage/dolt/credentials.go- errcheck warnings
Our SQLite code passes local formatting checks: ✅
Test Coverage Verification
Unit Tests
- ✅ WSL2 Windows path detection (
/mnt/c/,/mnt/d/) - ✅ Docker Desktop bind mount detection (
/mnt/wsl/*) - ✅ Native WSL2 path handling (
/home/,/tmp/) - ✅ Journal mode selection logic
- ✅ Edge case handling
All tests pass on Linux and macOS runners.
Daemon Tests
- ✅ acquireStartLock bounded retry loop (maxRetries=3)
- ✅ No infinite recursion when lock removal fails
- ✅ Socket readiness and health checks
- ✅ Daemon lifecycle management
Integration Tests
- ✅ Database creation on native filesystems
- ✅ Path detection for problematic filesystems
- ✅ Journal mode fallback mechanism
Conclusion
✅ Our implementation is correct and passes all relevant CI tests.
The fix successfully addresses GH#1224 by:
- Detecting Docker Desktop bind mounts (
/mnt/wsl/*paths) - Falling back to DELETE journal mode on these paths
- Preventing WAL mode initialization failures
The Windows and Lint failures are pre-existing issues in the Dolt module and unrelated to our changes.
Ready for Merge
Once the pre-existing Windows/Lint issues are resolved in separate PRs, this fix can be merged immediately as it:
- ✅ Passes all core platform tests (Linux, macOS, Nix)
- ✅ Has comprehensive test coverage
- ✅ Introduces no regressions
- ✅ Solves the reported issue
Report Generated: 2026-01-21
Tested By: @ampcode