arvryna / blazer

concurrent file downloader
Apache License 2.0
16 stars 3 forks source link

Handle SIGTERM / SIGINT signal gracefully #47

Open setraj opened 3 years ago

setraj commented 3 years ago

The process doesn't clean up the temp directory created for segment storage when it receives SIGTERM / SIGINT signal.

Screenshot 2021-08-10 at 7 35 18 PM
arvryna commented 3 years ago

I didn't handle this case because, i wanted to give user chance to continue from where it is left off, if he re-runs the command, maybe we can leave a note to user.

Sometimes people accidently press (control + c) or even if our program panics and cancels, why delete the files so the user has to spend time again to start from beginning.

setraj commented 3 years ago

Once the process is interrupted it is going to leave segment files (potentially uncompleted) that are not usable in the next try if I understand correctly? because next time we create a new session.

arvryna commented 3 years ago

Once the process is interrupted it is going to leave segment files (potentially uncompleted) that are not usable in the next try if I understand correctly?

Good point, we need to verify this doubt and also read necessary docs for io library. Please create an issue for this we will investigate. but if there is a log "Downloaded segment ..", that proves those segment downloaded successfully

image

because next time we create a new session.

Actually no, session ID = Hash(URL,threadcount) . so, with same params, we get same session ID and hence download resumes, we infact show a message to user that we are resuming download

arvryna commented 2 years ago

/good-first-issue