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

Handle SIGTERM / SIGINT signal gracefully #47

Open
setraj opened this issue Aug 10, 2021 · 4 comments
Open

Handle SIGTERM / SIGINT signal gracefully #47

setraj opened this issue Aug 10, 2021 · 4 comments

Comments

@setraj
Copy link
Collaborator

setraj commented Aug 10, 2021

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
Copy link
Owner

arvryna commented Aug 10, 2021

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
Copy link
Collaborator Author

setraj commented Aug 10, 2021

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
Copy link
Owner

arvryna commented Aug 10, 2021

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
Copy link
Owner

arvryna commented Jan 28, 2022

/good-first-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants