-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Streaming download from Swift in files_external #19002
Streaming download from Swift in files_external #19002
Conversation
A new inspection was created. |
@butonic one more question for you. |
cc @icewind1991 |
@owncloud-bot This is okay to test. @DeepDiver1975 CLA bot? ;-) |
Code looks good from what I know about swift, haven't got the chance to test atm |
Do we have swift covered by jenkins? |
cool 👍 wait for #14077, then rebase please |
I ran the tests locally and beside the expected fails, this branch has an additional fail:
To run the unit tests, I did this:
|
Sounds like it needs a check if the file exists and return false if it doesnt |
Hey all, i'm new. I'm not used to git yet so please be patient with me. It's a stream, so actually needs is_resource() or to test response header values. |
Speeds up downloads as they no longer need to buffer completely on the ownCloud server before being sent to the client.
043ae27
to
cb9a4d4
Compare
Looks like it's still happening:
@DanielTosello to run the unit tests you will need docker, and then run:
|
seems that you need to return false instead of NULL if fopen failed 😄 |
@PVince81 Thanks for your help. I'm currently wrestling with docker's default config under ubuntu. Using loopback devices seems to crash xenopathic's image on boot. EDIT: I thought i'd gotten it working under fedora but i'm currently getting 503 on every test. Assume that's a docker config issue on my end... (RESOLVED: firewalld; perm levels) I'm also seeing examples of this: #7897 (comment) when running the tests against a swift instance and they make very little sense to me. I don't suppose you remember how you resolved that? |
This was more complex than expected. Guzzle doesn't close streams that 404, so they're still valid resources even if they're empty. It was necessary to extract response text from response metadata explicitly. |
Unit tests pass locally now. Code looks good from my POV 👍 @butonic @icewind1991 second review ? |
@DanielTosello got curious about your solution and had a look how it was done for other storages types. Did you consider that approach too or did not know about it ? (I also just found out today 😄) |
@PVince81 I didn't know, & the Guzzle docs i found are not too good with regards to how to handle streams... i learned quite a few new things in doing this (including fun docker problems), and some of them are going to be really useful going forward. As you can probably see from my addition here, the biggest problem i had was actually locating the client response in the stream metadata package, so if there's a solution that mitigates the need for that i'm all for it. |
@DanielTosello @tjdett did you sign the contribution agreement already? |
Yes, let me find the statement from the other PR |
MIT license statement: #21008 (comment) |
@DeepDiver1975 CI passed in the CI ticket: #21729 Merge ? |
…nload Streaming download from Swift in files_external
Speeds up downloads as they no longer need to buffer completely on the ownCloud server before being sent to the client.
A downside of this implementation is that the file can only be traversed once. ownCloud never actually attempts to do this, and
r+
offers this behaviour if required.