Skip to content

ref: Change as_multipart_upload_backend to borrow instead of Arc#494

Closed
lcian wants to merge 2 commits into
matt/objectstore-cogs-metricfrom
lcian/ref/multipart-borrow
Closed

ref: Change as_multipart_upload_backend to borrow instead of Arc#494
lcian wants to merge 2 commits into
matt/objectstore-cogs-metricfrom
lcian/ref/multipart-borrow

Conversation

@lcian

@lcian lcian commented Jun 9, 2026

Copy link
Copy Markdown
Member

No description provided.

self.spawn("initiate_multipart", async move {
inner.initiate_multipart(&id, &metadata).await
inner
.as_multipart_upload_backend()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the only disadvantage, i.e. we will spawn a task unnecessarily upon every request if the backend doesn't support multipart uploads.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

actually, this lets us improve on the previous solution. we used to have to clone before we knew whether multipart was supported. now we don't. you can attempt the borrow without using the result like you did in CountingBackend

i'll incorporate this into my PR

@lcian lcian force-pushed the matt/objectstore-cogs-metric branch from a933c60 to 98f3aa7 Compare June 9, 2026 09:09
@lcian lcian force-pushed the lcian/ref/multipart-borrow branch from 974bcba to a1ec106 Compare June 9, 2026 09:09
@matt-codecov matt-codecov force-pushed the matt/objectstore-cogs-metric branch from 98f3aa7 to 2d61ae5 Compare June 9, 2026 17:12
@matt-codecov

Copy link
Copy Markdown
Contributor

absorbed into #492

@matt-codecov matt-codecov deleted the lcian/ref/multipart-borrow branch June 9, 2026 17:17
An error occurred while trying to automatically change base from matt/objectstore-cogs-metric to main June 9, 2026 17:17
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