summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-10-31 21:58:42 +0100
committerGitHub <noreply@github.com>2024-10-31 13:58:42 -0700
commite3aca49e25e70883fd45ec42c3a43fcd7fda5e29 (patch)
treeb4c98487e824cd0268f2f6a078031a0179ce8b9b /etc
parent94c29e1cfcc11c2d983513dfb65e3ab5bb13e161 (diff)
downloadspack-e3aca49e25e70883fd45ec42c3a43fcd7fda5e29.tar.gz
spack-e3aca49e25e70883fd45ec42c3a43fcd7fda5e29.tar.bz2
spack-e3aca49e25e70883fd45ec42c3a43fcd7fda5e29.tar.xz
spack-e3aca49e25e70883fd45ec42c3a43fcd7fda5e29.zip
database.py: remove process unsafe update_explicit (#47358)
Fixes an issue reported where `spack env depfile` + `make -j` would non-deterministically refuse to mark all environment roots explicit. `update_explicit` had the pattern ```python rec = self._data[key] with self.write_transaction(): rec.explicit = explicit ``` but `write_transaction` may reinitialize `self._data`, meaning that mutating `rec` won't mutate `self._data`, and the changes won't be persisted. Instead, use `mark` which has a correct implementation. Also avoids the essentially incorrect early return in `update_explicit` which is a pattern I don't think belongs in database.py: it branches on possibly stale data to realize there is nothing to change, but in reality it requires a write transaction to know that for a fact, but that would defeat the purpose. So, leave this optimization to the call site.
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions