GoogleCloudPlatform / GoogleCloudPlatform/gsutil
Support user-supplied precondition instead of retrieving read-modify-write in acl, setmeta
- 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
Assessment
This issue has not been assessed yet.