[AAP-103751] perf: fix tarball collection filtering, single-pass tar extraction, and S3 client caching #659
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 415 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #659"
general
weight: 0.35
redhat-chai-bot
Description
metrics_utility/automation_controller_billing/extract/base.py):Base.filter_tarball_paths()checkedif s.find('-unknown.') or s.find('-config.'): return True. Becausestr.find()returns-1when a substring is absent and-1is truthy in Python, the filter always returnedTrueand never excluded unrelated modern collection tarballs. Replaced with'-unknown.' in s or '-config.' in sand precompiled the legacy/modern suffix regexes with literal escaped dots (\.tar\.gz$). Legacy (<= 0.6.0),-unknown.,-config., and unexpected filenames remain unconditionally included. Removed the obsolete# FIXMEinextractor_s3.py.extract/base.py): Switched_safe_extract()fromfor member in tar.getmembers():tofor member in tar:and hoistedos.path.abspath(extract_path)out of the loop, avoiding decompressing.tar.gzarchives twice whenextractfile()rewinds a gzip stream.metrics_utility/automation_controller_billing/base/s3_handler.py): Cachedself._s3_clientandself._s3_resourceonS3Handler, and updatedupload_file()andlist_files()to useself.get_s3_client()directly rather than creating a newServiceResourceper call.Testing
Steps to Test
1. Run unit tests:
2. Run paired alternating-order benchmarks (3 pairs in separate processes) on a containerized AAP
cont_bController (automation-controller-task, Python 3.12.16, pandas 3.0.3):- Full 31-day / 124-archive synthetic CCSPv2 XLSX report (all optional sheets,
ccsp-experimental), checking workbook digests across all runs.-
S3Handlerworkload simulating 124list_files()+ 248download_file()calls using realboto3.Sessionwith stubbed transport.Expected Results
process_tarballs()calls dropped from 496 to 248 (−50%) (eliminating 50%–75% of redundant S3 downloads on S3 targets), peak RSS unchanged (278.45 → 278.79 MiB), all 6 workbook digests matched.S3Handlerclient caching (synthetic 124list_files+ 248download_file): median wall time dropped from 1.51 s to 0.10 s (−93.22%), boto3 clients created 372 → 1, resources 124 → 0, peak RSS62.18 → 59.30 MiB, output digests matched.(Synthetic source-checkout measurements in a disposable Controller container; not a guarantee for every customer workload.)
Self-Review Checklist
Code Quality
- If updates are required in the handbook, create a separate PR for the handbook repo.