Skip to content

fix(objectstorage): stop initial range downloads on close - #2176

Merged
Max Smythe (maxsmythe) merged 1 commit into
agent-substrate:mainfrom
ktsoator:fix/close-initial-range-reader
Oct 6, 2026
Merged

Max Smythe (maxsmythe) merged 1 commit into
agent-substrate:mainfrom
ktsoator:fix/close-initial-range-reader

Conversation

@ktsoator

Copy link
Copy Markdown
Contributor

Closing a partially consumed download currently cancels later range requests but leaves the initial reader open.

Close that reader too, and cancel its GCS context before closing it to prevent the SDK from reopening the request. Add regression tests for closing the initial reader and canceling requests.

Refs #2155

  • go test -race ./pkg/objectstorage -count=1 -timeout 3m
  • go vet ./pkg/objectstorage and scoped golangci-lint

Close the initial reader when the returned download reader is closed so
an early close does not leave the first request running. Cancel the GCS
request context before closing its body to prevent the SDK from reopening it.

@maxsmythe Max Smythe (maxsmythe) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for the PR!

@maxsmythe Max Smythe (maxsmythe) added kind/bug Something isn't working / bugfixes area/storage labels Oct 6, 2026
@maxsmythe
Max Smythe (maxsmythe) added this pull request to the merge queue Oct 6, 2026
Merged via the queue into agent-substrate:main with commit 46c15e9 Oct 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants