Skip to content

refactor(io)!: make writes and walks context-aware - #2336

Merged
zeroshade merged 2 commits into
apache:mainfrom
fallintoplace:refactor/io-write-context-aware-20261026
Oct 27, 2026
Merged

zeroshade merged 2 commits into
apache:mainfrom
fallintoplace:refactor/io-write-context-aware-20261026

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Make WriteFileIO.Create, WriteFileIO.WriteFile, and ListableIO.WalkDir accept context.Context.

Why

Cloud writes and directory listings need caller cancellation.

Implementation

  • Pass context through catalog and maintenance calls.
  • Use it for Go Cloud writes and listings.
  • Add a compatibility note.

Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@fallintoplace fallintoplace changed the title refactor(io)!: make cloud file-writing operations context-aware refactor(io)!: make writes and walks context-aware Oct 26, 2026

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Threading ctx through Create/WriteFile/WalkDir completes what #2067 started, and the cleanup paths (manifest writer setup, manifest-list write, rewritten/filtered manifests, merge/cluster orphans) all use context.WithoutCancel, so a canceled commit still cleans up. The errgroup writers close inside their goroutines, so nothing outlives the group context. On a merge with current main, go vet ./... (including -tags integration) and the full go test ./... pass. One non-blocking nit: writeVersionHint runs after the commit has landed, so a canceled ctx there just leaves the hint stale; context.WithoutCancel(ctx) would match the cleanup paths, and the "no caller context" comment above its Remove is now outdated. LGTM.

@zeroshade
zeroshade merged commit d6039b7 into apache:main Oct 27, 2026
16 of 17 checks passed
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.

2 participants