I'm using boto3 to download files from an s3 bucket & I need to support canceling an active file transfer in my client UI - but I can't find how to do it.
There is a progress callback that I can use for transfer status, but I can not cancel the transfer from there.
I did find that boto3's s3transfer.TransferManager
object has a .shutdown()
member, but it is buggy (.shutdown() passes the wrong params to ._shutdown() a few lines below it) & crashes.
Is there another way to safely cancel an active file_download?
I apologize as I do not have enough rep to post a comment, I wanted to point you towards the S3Control docs, as it appears that you might be able to schedule the download operations as jobs and then also use update_job_status(**kwargs)
to cancel the job should it no longer be needed. I have not tested this, so feel free to downvote if not useful.
edit: I have enough rep to comment on future questions, thanks fam.
Can you kill the process associated with the file?
kill $(ps -ef | grep 'process-name' | awk '{print $2}')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With