diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2021-11-10 21:57:39 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-10 22:47:56 +0000 |
commit | 524581bfe2291d929ded715c3f33188f8a0dd36d (patch) | |
tree | 1372867d442ce6c2da1e1423107eec5c0582cf0c /site_scons | |
parent | 7836a39feba905c3c4596669b79c05fd93a7f424 (diff) | |
download | mongo-524581bfe2291d929ded715c3f33188f8a0dd36d.tar.gz |
SERVER-61358 fix cachedir handling of file being removed out from under the build.
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/validate_cache_dir.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/site_scons/site_tools/validate_cache_dir.py b/site_scons/site_tools/validate_cache_dir.py index 8491b135b54..2c78fb7deca 100644 --- a/site_scons/site_tools/validate_cache_dir.py +++ b/site_scons/site_tools/validate_cache_dir.py @@ -103,7 +103,7 @@ class CacheDirValidate(SCons.CacheDir.CacheDir): csig = f_out.read().decode().strip() except OSError as ex: raise InvalidChecksum(cls.get_hash_path(src_file), dst, f"failed to read hash file: {ex}") from ex - finally: + else: if not csig: raise InvalidChecksum(cls.get_hash_path(src_file), dst, f"no content_hash data found") @@ -223,14 +223,12 @@ class CacheDirValidate(SCons.CacheDir.CacheDir): def clean_bad_cachefile(self, node, cache_csig, computed_csig): cksum_dir = pathlib.Path(self.cachepath(node)[1]) - - try: - pathlib.Path(self.get_bad_cachefile_path(cksum_dir)).touch() - except FileExistsError: - pass - rm_path = f"{cksum_dir}.{SCons.CacheDir.cache_tmp_uuid}.del" try: + try: + pathlib.Path(self.get_bad_cachefile_path(cksum_dir)).touch() + except FileExistsError: + pass cksum_dir.replace(rm_path) except OSError as ex: msg = f"Failed to rename {cksum_dir} to {rm_path}: {ex}" |