-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
memoize: add user feedback and configurable timeout for flock #9262
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughModifies the memoization cache file locking mechanism in a single script to replace immediate blocking locks with non-blocking, timed locks featuring configurable retry intervals and maximum wait durations, with periodic status alerts during the waiting period. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When the memoize cache lock is held by another process (e.g., a stale Docker container from a previous interrupted build), the build would hang indefinitely without any feedback to the user. This change: - First tries non-blocking flock, acquiring immediately if available - If lock is busy, informs user and waits with periodic status messages - Adds MEMOIZE_FLOCK_WAIT_INTERVAL (default 10s) for message frequency - Adds MEMOIZE_FLOCK_MAX_WAIT (default 0=infinite) for optional timeout - Allows user to interrupt with Ctrl+C - Suggests checking for stale containers: docker ps -a | grep armbian 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2cd603a to
a968504
Compare
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @iav. * #9262 (comment) The following files were modified: * `lib/functions/general/memoize-cached.sh`
Summary
MEMOIZE_FLOCK_MAX_WAITenvironment variableProblem
When a build is interrupted (e.g., via Ctrl+C or system crash), Docker containers may continue running and hold flock locks on memoize cache files in
cache/memoize/. Subsequent builds would hang indefinitely at the "artifact [ kernel :: kernel() ]" stage without any feedback to the user.Solution
Instead of blocking indefinitely on
flock, this change:flock -n- acquires immediately if availabledocker ps -a | grep armbianNew Configuration Variables
MEMOIZE_FLOCK_WAIT_INTERVALMEMOIZE_FLOCK_MAX_WAITTest plan
MEMOIZE_FLOCK_MAX_WAIT=30and test timeout behavior🤖 Generated with Claude Code