Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Copy blob to client and use in compose when composing a new blob from a single blob #15

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ericenns
Copy link

In our app we wanted to reduce data handling in compose when only a single source blob is provided. To reduce data handling, I have added in support for copy-blob.

Now compose has slightly different behaviour. When a single source key is specified, the compose method will instead use copy-blob operation, otherwise the existing behaviour remains.

@JoeDupuis
Copy link
Member

Looks good! Thank you for the contribution!

Any reason for using put blob from url instead of copy blob from url?

Copy blob is async, but copy blob from url is synchronous and would unblock 256MB limit instead of 5MB.

I did some testing by omitting x-ms-blob-type and passing x-ms-requires-sync instead seem to work.

We'll need a changelog entry too.

Thank you!

@ericenns
Copy link
Author

ericenns commented Feb 6, 2025

Looks good! Thank you for the contribution!

Any reason for using put blob from url instead of copy blob from url?

Copy blob is async, but copy blob from url is synchronous and would unblock 256MB limit instead of 5MB.

I did some testing by omitting x-ms-blob-type and passing x-ms-requires-sync instead seem to work.

We'll need a changelog entry too.

Thank you!

I originally was using copy blob from url but it was failing for some reason, which I now realize was because I was not using a signed uri, which I found that I needed to use for put blob from url.

Even though put blob from url has a 5000MiB limit versus the 256MiB limit for copy blob from url, I have chosen to revert to using copy blob from url as we have been getting random failures trying to copy large blobs 3GB plus. The failures are timeout failures as the put method in this library has a default timeout of 60s. So instead of adding timeout handling in compose when using copy_blob reducing the limit to 256MiB might just be the best choice.

If you feel that this is too much of a risk for this library, i.e. using copy_blob in compose which could potentially timeout and fail instead of stream which I guess could also have the same issue though we have never encountered it.

@ericenns
Copy link
Author

ericenns commented Feb 6, 2025

@JoeDupuis what do you think about me adding an faster_compose: true option to the library and if set to true compose will use copy_blob for files <= 256MIB. The name is just an idea, but then users of this library can decide if they want that behaviour.

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