diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2022-01-18 12:00:26 -0600 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-18 18:35:16 +0000 |
commit | 15c9d98aea11fa19cd002cec5137c740417c405a (patch) | |
tree | 4f8791683a1e56b7c039501117fbce8b002e2821 /site_scons | |
parent | 1746c701d666b45f7df770d25a8b09a3d1e22fa1 (diff) | |
download | mongo-15c9d98aea11fa19cd002cec5137c740417c405a.tar.gz |
Revert "SERVER-62285 added processing of cache-dir push failures"
This reverts commit ee974eefd38564d69147cda4acd34c54f2796760.
Diffstat (limited to 'site_scons')
-rw-r--r-- | site_scons/site_tools/validate_cache_dir.py | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/site_scons/site_tools/validate_cache_dir.py b/site_scons/site_tools/validate_cache_dir.py index e6d9118d3d1..2c78fb7deca 100644 --- a/site_scons/site_tools/validate_cache_dir.py +++ b/site_scons/site_tools/validate_cache_dir.py @@ -24,7 +24,6 @@ import datetime import json import logging import os -import sys import pathlib import shutil import traceback @@ -34,10 +33,7 @@ import SCons cache_debug_suffix = " (target: %s, cachefile: %s) " -class ValidateCacheDirError(SCons.Errors.BuildError): - pass - -class InvalidChecksum(ValidateCacheDirError): +class InvalidChecksum(SCons.Errors.BuildError): def __init__(self, src, dst, reason, cache_csig='', computed_csig=''): self.message = f"ERROR: md5 checksum {reason} for {src} ({dst})" self.cache_csig = cache_csig @@ -45,14 +41,14 @@ class InvalidChecksum(ValidateCacheDirError): def __str__(self): return self.message -class CacheTransferFailed(ValidateCacheDirError): +class CacheTransferFailed(SCons.Errors.BuildError): def __init__(self, src, dst, reason): self.message = f"ERROR: cachedir transfer {reason} while transfering {src} to {dst}" def __str__(self): return self.message -class UnsupportedError(ValidateCacheDirError): +class UnsupportedError(SCons.Errors.BuildError): def __init__(self, class_name, feature): self.message = f"{class_name} does not support {feature}" @@ -178,7 +174,7 @@ class CacheDirValidate(SCons.CacheDir.CacheDir): try: return super().push(node) except CacheTransferFailed as ex: - self.print_push_issue(node, ex) + self.print_cache_issue(node, ex) return False def CacheDebugJson(self, json_data, target, cachefile): @@ -201,17 +197,6 @@ class CacheDirValidate(SCons.CacheDir.CacheDir): self.json_log.write(json.dumps(json_data) + '\n') def CacheDebug(self, fmt, target, cachefile): - - # Capture exception information for exception types - # which may bubble up from SCons proper. Non ValidateCacheDirError - # failures which come up from SCons may omit exception information. - # if this is a Non ValidateCacheDirError exception, we will emit a ValidateCacheDirError - # in place, which will capture the exception information and come back through - # this function to be logged in our normal CacheDirValidate process. - ex = sys.exc_info()[1] - if ex and not isinstance(ex, ValidateCacheDirError): - raise CacheTransferFailed(target, cachefile, f"failed: {ex}") from ex - # The target cachefile will live in a directory with the special # extension for this cachedir class. Check if this cachefile is # in a directory like that and customize the debug logs. @@ -227,14 +212,6 @@ class CacheDirValidate(SCons.CacheDir.CacheDir): self.CacheDebug(log_msg + cache_debug_suffix, realnode, cachefile) self.CacheDebugJson(json_info, realnode, cachefile) - def print_push_issue(self, node, ex): - - cksum_dir = pathlib.Path(self.cachepath(node)[1]) - msg = ('An issue was detected while pushing to the cache:\n' + - ' ' + "\n ".join("".join(traceback.format_exc()).split("\n"))) - - self._log(msg, str(ex), {'type': 'push_fail', 'error': msg}, node, cksum_dir) - def print_cache_issue(self, node, ex): cksum_dir = pathlib.Path(self.cachepath(node)[1]) |