Skip to content

refactor(io): hand out S3 delegates by shared_ptr and build them off the lock - #898

Open
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:refactor-s3-delegate-lifetime
Open

refactor(io): hand out S3 delegates by shared_ptr and build them off the lock#898
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:refactor-s3-delegate-lifetime

Conversation

@plusplusjiajia

Copy link
Copy Markdown
Member

ArrowS3FileIO's per-credential delegates were raw references into an unsynchronized vector: SetStorageCredentials rebuilt it while a concurrent operation could still hold one, and building an S3 client — which can reach the network for bucket-region discovery — happened with no locking at all.

This gives ArrowS3FileIO the treatment #889 gave ResolvingFileIO: delegates held and handed out by shared_ptr, state under a shared_mutex, delegate construction moved off the lock, and DeleteFiles matching every location against one snapshot so a batch sees a single delegate generation.SupportsStorageCredentials::credentials() returns by value, since a reference can dangle once a concurrent install replaces the vector.

@plusplusjiajia
plusplusjiajia force-pushed the refactor-s3-delegate-lifetime branch from 8f33e30 to ea3d7cd Compare August 24, 2026 10:40
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