From d8ce1b3cb4f743a5842d203fd82ea8ebe2ba96f8 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 1 Feb 2024 14:57:17 +0530 Subject: [PATCH 1/2] fix: increase tar file limit including node_modules in tar blob causes file counts to be consistently above 10k eg: - gameplan: 25,269 - hrms: 32,369 --- bench/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bench/app.py b/bench/app.py index 01c5f15d..1afd6c75 100755 --- a/bench/app.py +++ b/bench/app.py @@ -370,8 +370,9 @@ class App(AppMeta): click.secho(f"Getting {self.app_name} from cache", fg="yellow") with tarfile.open(cache_path, mode) as tar: + extraction_filter = get_app_cache_extract_filter(count_threshold=150_000) try: - tar.extractall(app_path.parent, filter=get_app_cache_extract_filter()) + tar.extractall(app_path.parent, filter=extraction_filter) except Exception: logger.exception(f"Cache extraction failed for {self.app_name}") shutil.rmtree(app_path) From 863dde6acd58b5f9e5a72a991f7e89ca1fcb4536 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 1 Feb 2024 15:00:20 +0530 Subject: [PATCH 2/2] chore: indicate on cache extraction failure --- bench/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bench/app.py b/bench/app.py index 1afd6c75..e176739c 100755 --- a/bench/app.py +++ b/bench/app.py @@ -374,7 +374,9 @@ class App(AppMeta): try: tar.extractall(app_path.parent, filter=extraction_filter) except Exception: - logger.exception(f"Cache extraction failed for {self.app_name}") + message = f"Cache extraction failed for {self.app_name}, skipping cache" + click.secho(message, fg="yellow") + logger.exception(message) shutil.rmtree(app_path) return False