Skip to content

fix: fix a race condition caused due to concurrent writes#785

Open
nidhiii-27 wants to merge 3 commits into
googleapis:mainfrom
nidhiii-27:race-in-uploads
Open

fix: fix a race condition caused due to concurrent writes#785
nidhiii-27 wants to merge 3 commits into
googleapis:mainfrom
nidhiii-27:race-in-uploads

Conversation

@nidhiii-27
Copy link
Copy Markdown

Fixes b/497758223

In update_appendable_blob and finalize_blob, the Testbench was assigning blob.media = upload.media (reference assignement). Because upload.media is a mutable buffer that can be reallocated or modified by concurrent gRPC writer threads, the "database" pointer could end up pointing to stale or uninitialized memory. This resulted in "Torn Writes" where the final object contained leaked memory addresses and null bytes instead of the intended data.

@nidhiii-27 nidhiii-27 marked this pull request as ready for review March 31, 2026 10:54
@nidhiii-27 nidhiii-27 requested a review from a team as a code owner March 31, 2026 10:54
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