GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Support user-supplied precondition instead of retrieving read-modify-write in acl, setmeta

Open
#461 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

Currently the `acl` and `setmeta` commands perform a read-modify-write and add a precondition to the write.

If the write request dies or times out in the service (but still succeeds), this can result in a PreconditionException upon retry even though the acl/metadata change was committed successfully. A script calling `gsutil` must deal with this exception even if they can guarantee via their application design that there are no concurrent writers.

It's safest for gsutil to supply the read-modify-write preconditions to protect against racing writers, but if the user supplies a precondition (via `-h "x-goog-metageneration-match:x"`), those commands should instead respect that precondition.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.