space-cloud
space-cloud copied to clipboard
file storage module should abort file download on request cancellation
Describe the bug
Space Cloud's file store read operation makes a copy of the file locally in the /tmp/
folder. However, in the case of big files, the user might close the frontend application. Space Cloud still keeps downloading that file into the /tmp
folder. It does not abort the download when the request from the frontend itself is cancelled.
Expected behaviour
Space Cloud should stop downloading the file.
Actual behaviour
Space Cloud keeps downloading the file.
Steps to reproduce
I tried this with AWS only. Not sure if this same bug exists for other file store providers as well. Here are the reproduce steps:
- Configure space cloud to use amazon s3 as the file store driver.
- Upload a big file 40-50 MB using space cloud's file store API.
- Exec into the gateway container and change directory to
/tmp/
- Paste the download URL (via Space Cloud's file store API) in a new browser tab and hit enter.
- Run the following command now in the gateway container:
du -h -a -d 1
. This command would list the files in the/tmp/
folder along with their sizes. - Now close the browser tab through which the read request was made. Then repeat the same command
du -h -a -d 1
a few times to confirm that the temp file created because of this read request is increasing in size.
Your environment
- Space Cloud version: v0.19.1
- Kubernetes or Docker: Docker
- Filestore driver: amazon-s3
- Browser (if applicable): Chrome
If this bug restricts your use of space-cloud, give it a thumbs up reaction, so that we can determine which bugs need to be fixed immediately. 👍