[reclient] Dont fail build if previous reproxy instance failed to shutdown

This is caused by the previous reproxy instance still having the log files open for writing. Bootstrap will kill that instance on startup of the next build but that only happens after we try and create the log dir

Bug: b/290230382
Change-Id: Idd88cfa9c571c0bca078f8bf0078fdb3941603ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4670328
Commit-Queue: Ben Segall <bentekkie@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Auto-Submit: Ben Segall <bentekkie@google.com>
changes/28/4670328/3
Ben Segall 2 years ago committed by LUCI CQ
parent 7a171a5594
commit 7899866866

@ -151,8 +151,14 @@ def set_reproxy_path_flags(out_dir, make_dirs=True):
cache_dir = find_cache_dir(tmp_dir)
if make_dirs:
if os.path.exists(log_dir):
# Clear log dir before each build to ensure correct metric aggregation.
shutil.rmtree(log_dir)
try:
# Clear log dir before each build to ensure correct metric aggregation.
shutil.rmtree(log_dir)
except OSError:
print(
"Couldn't clear logs because reproxy did "
"not shutdown after the last build",
file=sys.stderr)
os.makedirs(tmp_dir, exist_ok=True)
os.makedirs(log_dir, exist_ok=True)
os.makedirs(cache_dir, exist_ok=True)

Loading…
Cancel
Save