Skip to content

Extract prefix locks and failure markers from Database#39024

Merged
haampie merged 12 commits intospack:developfrom
alalazo:refactor/extract_prefix_and_failure_markers
Aug 7, 2023
Merged

Extract prefix locks and failure markers from Database#39024
haampie merged 12 commits intospack:developfrom
alalazo:refactor/extract_prefix_and_failure_markers

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Jul 20, 2023

Summary

This PR extracts two responsibilities from the Database class:

  1. Managing locks for prefixes during an installation
  2. Marking installation failures

and pushes them into their own class (SpecLocker and FailureMarker). These responsibilities are also pushed up into the Store, leaving to Database only the duty to manage index.json files.

Locking

SpecLocker classes no longer share a global list of locks, but locks are per instance. Their identifier is simply (dag hash, package name), and not the spec prefix path, to avoid circular dependencies across Store / Database / Spec.

@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality tests General test capability(ies) labels Jul 20, 2023
@spackbot-app spackbot-app bot added the stage label Aug 7, 2023
@haampie haampie force-pushed the refactor/extract_prefix_and_failure_markers branch from 944f9b6 to a1f4128 Compare August 7, 2023 09:22
@haampie
Copy link
Copy Markdown
Member

haampie commented Aug 7, 2023

a1f4128 is just because flake8 doesn't like type(...) == ... anymore.

Copy link
Copy Markdown
Member

@haampie haampie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving @alalazo's part ;)

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 7, 2023

I approve @haampie 's part, even though I can't ✔️ on a PR I submitted 😆

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 7, 2023

Well, first example of pair programming in Spack over slack 🙂

@haampie haampie enabled auto-merge (squash) August 7, 2023 09:51
@haampie haampie merged commit ba1d295 into spack:develop Aug 7, 2023
@alalazo alalazo deleted the refactor/extract_prefix_and_failure_markers branch August 7, 2023 10:58
mpokorny pushed a commit to mpokorny/spack that referenced this pull request Sep 18, 2023
This PR extracts two responsibilities from the `Database` class:
1. Managing locks for prefixes during an installation
2. Marking installation failures

and pushes them into their own class (`SpecLocker` and `FailureMarker`). These responsibilities are also pushed up into the `Store`, leaving to `Database` only the duty to manage `index.json` files.

`SpecLocker` classes no longer share a global list of locks, but locks are per instance. Their identifier is simply `(dag hash, package name)`, and not the spec prefix path, to avoid circular dependencies across Store / Database / Spec.
alalazo added a commit to alalazo/spack that referenced this pull request Jul 9, 2024
This fixture was introduced in spack#16429, and made
redundant in spack#39024
haampie pushed a commit that referenced this pull request Jul 9, 2024
This fixture was introduced in #16429, and made
redundant in #39024
hariharan-devarajan pushed a commit to hariharan-devarajan/spack that referenced this pull request Jul 10, 2024
FrederickDeny pushed a commit to FrederickDeny/spack that referenced this pull request Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands core PR affects Spack core functionality stage tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants