Skip to content

Commit

Permalink
Detect delete markers in our s3 cache of native_engine.so. (#11140)
Browse files Browse the repository at this point in the history
If an object was deleted, it may still have a non-current version.

[ci skip-rust]

[ci skip-build-wheels]
  • Loading branch information
benjyw authored Nov 11, 2020
1 parent aab90c2 commit 516be49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build-support/bin/bootstrap_and_deploy_ci_pants_pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def native_engine_so_in_s3_cache(*, aws_bucket: str, native_engine_so_aws_key: s
if not ls_output:
return False
versions = json.loads(ls_output).get("Versions")
if versions is None:
if not versions:
return False
if len(versions) > 1:
die(
Expand All @@ -133,6 +133,10 @@ def native_engine_so_in_s3_cache(*, aws_bucket: str, native_engine_so_aws_key: s
"in Slack so that we may investigate how this happened and delete the duplicate "
"copy from S3."
)
if not versions[0]["IsLatest"]:
# If the single version is not the latest, it means there is a delete marker that
# supersedes it.
return False
return True


Expand Down

0 comments on commit 516be49

Please sign in to comment.