google-cloud-python
google-cloud-python copied to clipboard
Avoid simultaneous read-modify-write race condition in Python
In the cloud storage documentation, there is an example of how to avoid simultaneous read-modify-write race conditions using the JSON API. https://cloud.google.com/storage/docs/generations-preconditions#examples_of_race_conditions
Since we are encouraged to use one of the client libraries instead of the JSON API, how do we replicate this functionality in Python?
See #4490. Supporting generations / metagenerations and the corresponding precondition headers is on the list of GCS features being prioritized, but we don't have a concrete timeframe.
/cc @frankyn