You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cancel the SDK upload when CreateObject input reading fails #5259
CreateObject returns immediately when copying from its input reader fails. If the SDK writer has already been opened, it can remain active because that path neither closes nor cancels it. Closing it normally would be wrong because that could finalize a partial object.
I plan to give this single-object upload an owned child context and always cancel it on return. A small buffered-write regression verifies that a source error cancels the SDK writer, preserves the original error, leaves the caller context active, and does not publish the partial object. It passes 20 race-enabled repetitions and the existing bucket-adapter tests.
This is the existing CreateObject adapter, not the new unbuffered handler or its Abort work in #5232. No live GCS data or credentials are used by the regression.
Hi @vadlakondaswetha, Currently for staging writes we do not create a separate context for the Go SDK writer, hence we cannot cancel it if io.Copy fails mid-upload, which leaks writer resources. Creating a child context and canceling it on return looks good to me. PTAL!
Activity
vipnydav commentedon Nov 29, 2026
Hi @vadlakondaswetha, Currently for staging writes we do not create a separate context for the Go SDK writer, hence we cannot cancel it if
io.Copyfails mid-upload, which leaks writer resources. Creating a child context and canceling it on return looks good to me. PTAL!