You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dlx-package): add process-lock for concurrent installation protection
Wrap ensurePackageInstalled() with processLock.withLock() to prevent
concurrent installations from corrupting the cache. This aligns Socket's
dlx implementation with npm npx's concurrency.lock strategy.
Key changes:
- Lock file created at ~/.socket/_dlx/<hash>/.lock
- Uses 5s stale timeout and 2s periodic touching (aligned with npm npx)
- Double-check pattern: verify installation after acquiring lock
- Prevents race conditions when multiple processes install same package
This completes 100% alignment with npm's npx locking mechanism, closing
the final gap identified in lock-and-dlx-comparison.md.
All 30 existing tests pass with the new locking behavior.
0 commit comments