summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2024-05-21 21:16:04 +0200
committerGitHub <noreply@github.com>2024-05-21 13:16:04 -0600
commit3f472039c55cd7a5d73fb0b0bf63317669733e8a (patch)
tree4e4627b0aa1942da14732b2321326f2656cb00fd
parent912ef34206676419aaa604e3a16a934c1b5fe4f7 (diff)
downloadspack-3f472039c55cd7a5d73fb0b0bf63317669733e8a.tar.gz
spack-3f472039c55cd7a5d73fb0b0bf63317669733e8a.tar.bz2
spack-3f472039c55cd7a5d73fb0b0bf63317669733e8a.tar.xz
spack-3f472039c55cd7a5d73fb0b0bf63317669733e8a.zip
Take a lock before querying installed_dependents (#44301)
Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
-rw-r--r--lib/spack/spack/cmd/uninstall.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py
index 2022290057..d51a8f8e3b 100644
--- a/lib/spack/spack/cmd/uninstall.py
+++ b/lib/spack/spack/cmd/uninstall.py
@@ -151,7 +151,8 @@ def installed_dependents(specs: List[spack.spec.Spec]) -> List[spack.spec.Spec]:
key=lambda s: s.dag_hash(),
)
- return [spec for spec in specs if is_installed(spec)]
+ with spack.store.STORE.db.read_transaction():
+ return [spec for spec in specs if is_installed(spec)]
def dependent_environments(