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

Improve locking UX #17904

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Improve locking UX #17904

merged 1 commit into from
Jul 30, 2024

Conversation

MikeMcQuaid
Copy link
Member

My experience recently playing around with our locking behaviour is that, while mostly seamless and not seen by users, it's leaks implementation details a bit too heavily.

As a result, the following improvements are in this PR:

  • Ensure that, whenever possible, we tell the user the actual command that is holding a given lock instead of the lock name (an internal implementation detail)
  • Make the locking error output a little more consistent and user friendly
  • Add a DownloadLock class to simplify locking downloads
  • Add a HOMEBREW_LOCK_CONTEXT variable to allow adding additional context for logging error messages
  • Lock paths and leave deciding how this translates to lock names up to the locking code itself
  • Lock the Cellar/Caskroom paths explicitly rather than implicitly

Library/Homebrew/download_strategy.rb Outdated Show resolved Hide resolved
Library/Homebrew/lock_file.rb Show resolved Hide resolved
Library/Homebrew/env_config.rb Outdated Show resolved Hide resolved
@MikeMcQuaid MikeMcQuaid force-pushed the lock_improvements branch 2 times, most recently from 5c0420b to 99c9899 Compare July 30, 2024 16:36
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review July 30, 2024 16:38
My experience recently playing around with our locking behaviour is
that, while mostly seamless and not seen by users, it's leaks
implementation details a bit too heavily.

As a result, the following improvements are in this commit:
- Ensure that, whenever possible, we tell the user the actual command
  that is holding a given lock instead of the lock name (an internal
  implementation detail)
- Make the locking error output a little more consistent and user
  friendly
- Add a `DownloadLock` class to simplify locking downloads
- Add a `HOMEBREW_LOCK_CONTEXT` variable to allow adding additional
  context for logging error messages
- Lock paths and leave deciding how this translates to lock names up
  to the locking code itself
- Lock the Cellar/Caskroom paths explicitly rather than implicitly

Co-authored-by: Carlo Cabrera <[email protected]>
@MikeMcQuaid MikeMcQuaid merged commit ca22e9c into master Jul 30, 2024
25 checks passed
@MikeMcQuaid MikeMcQuaid deleted the lock_improvements branch July 30, 2024 17:02
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

Successfully merging this pull request may close these issues.

3 participants