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

Add locks and proper file management facades #121

Merged
merged 3 commits into from
Jun 2, 2022
Merged

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Jun 2, 2022

Fixes #115

  • New FileLock type for managing a lockfile, used for both the cache and supply-chain (separate locks)
  • New Store type that wraps config.toml/audits.toml/imports.lock
    • Manages acquiring the FileLock
    • Manages loading the files and validating their consistency (stubbed, not implemented)
    • Manages fetching imports and checking for criteria changes (checking is stubbed)
    • Manages storing the files back (only done when manually requested by a command to avoid changes on-error)
  • All commands that touch supply-chain now unconditionally acquire it and commit it on success
    • This means every (non-freestanding, non-debug) command will try to validate+fetch-imports+fmt

Drive-by changes:

  • notes on audits were moved back up due to limitations in toml-rs around nested tables. More aggressively trying to fmt+commit exposed this issue
  • --readonly-lockless was added as a hack to disable the supply-chain lock for concurrent tests

Gankra added 2 commits June 2, 2022 13:25
* Add a --readonly-lockless flag for concurrent tests
* Move notes back up in unaudited to avoid serialization problem
@Gankra
Copy link
Contributor Author

Gankra commented Jun 2, 2022

Oh whoops I missed some cases, one sec

@Gankra
Copy link
Contributor Author

Gankra commented Jun 2, 2022

There we go

@bholley bholley merged commit 37e5270 into mozilla:main Jun 2, 2022
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.

Implement proper locking of the cache
2 participants