Skip to content

Revert "Concretization Cache: Refactor + manifest testing"#50851

Merged
tgamblin merged 1 commit intodevelopfrom
revert-49589-concretization-cache/cleanup-and-test
Jun 7, 2025
Merged

Revert "Concretization Cache: Refactor + manifest testing"#50851
tgamblin merged 1 commit intodevelopfrom
revert-49589-concretization-cache/cleanup-and-test

Conversation

@tgamblin
Copy link
Copy Markdown
Member

@tgamblin tgamblin commented Jun 7, 2025

Reverts #49589

There are, unfortunately, races in the cleanup code. We are seeing issues like this in CI:

        for bucket in self.cache_buckets():
            with self._fc.read_transaction(bucket) as f:
                if not f:
>                   raise RuntimeError(
                        "Attempting to clean non existent cache bucket" f" {bucket.name}"
                    )
E                   RuntimeError: Attempting to clean non existent cache bucket nc

lib/spack/spack/solver/asp.py:660: RuntimeError

and, more frequently:

self = PosixPath('/Users/runner/.local/state/spack/tv6pwnm/misc-cache/concretization/hy/hyrtccditoupfm3s64poficxh5cisl6d')

    def stat(self, *, follow_symlinks=True):
        """
        Return the result of the stat() system call on this path, like
        os.stat() does.
        """
>       return os.stat(self, follow_symlinks=follow_symlinks)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       FileNotFoundError: [Errno 2] No such file or directory: '/Users/runner/.local/state/spack/tv6pwnm/misc-cache/concretization/hy/hyrtccditoupfm3s64poficxh5cisl6d'

The second issue appears to be that this sort:

        rm_reg.sort(key=lambda x: x.stat().st_mtime, reverse=True)

is calling stat() redundantly on entries while not holding any read lock on them. I suspect the first is also a race on bucket creation and deletion.

We can work this out later and merge for 1.1.

@spackbot-app spackbot-app bot added core PR affects Spack core functionality defaults documentation Improvements or additions to documentation tests General test capability(ies) utilities labels Jun 7, 2025
@tgamblin tgamblin requested a review from scheibelp June 7, 2025 06:50
@alalazo alalazo self-assigned this Jun 7, 2025
@tgamblin tgamblin merged commit 29ff69e into develop Jun 7, 2025
5 of 6 checks passed
@tgamblin tgamblin deleted the revert-49589-concretization-cache/cleanup-and-test branch June 7, 2025 06:55
@tgamblin tgamblin mentioned this pull request Jun 7, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality defaults documentation Improvements or additions to documentation tests General test capability(ies) utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants