Skip to content

Return the uploaded GCS generation without reloading - #10

Open
janbjorge wants to merge 2 commits into
claude/code-review-bugs-vokwlk-07-filesystem-atomic-writefrom
claude/code-review-bugs-vokwlk-08-gcs-no-reload
Open

janbjorge wants to merge 2 commits into
claude/code-review-bugs-vokwlk-07-filesystem-atomic-writefrom
claude/code-review-bugs-vokwlk-08-gcs-no-reload

Conversation

@janbjorge

@janbjorge janbjorge commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Stack 8/9, base #9.

blob.reload() cost a round trip and could return a newer writer's generation. upload_from_string() already sets blob.generation.

Tests: test_sync_write_does_not_reload_blob_after_upload, test_sync_write_returns_uploaded_generation_not_a_later_one fail on base; test_sync_write_precondition_failed_does_not_reload passes on both.

_sync_write called blob.reload() after upload_from_string() to read the
new generation. That is an extra metadata round trip on every write,
and it is racy: if another writer committed between our upload and the
reload, we returned their generation as our etag.

upload_from_string() already sets the blob's properties from the upload
response, so blob.generation is exactly the generation we wrote. Return
it directly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant