Skip to content

Revert "fix ugly error message when killing commands" #1081

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

Closed

Conversation

torarnv
Copy link
Contributor

@torarnv torarnv commented Apr 14, 2015

This reverts commit f74e71f.

The 'Online' flag of the command context does not seem to be set in
any code paths, at least not when running commands such as 'ipfs daemon'
or 'ipfs ping'. The result after f74e71f is that we never shutdown
cleanly, as we'll always os.Exit(0) from the interrupt handler.

The os.Exit(0) itself is also dubious, as conceptually the interrupt
handler should ask whatever is stalling to stop stalling, so that
main() can return like normal. Exiting with -1 in error cases where
the interrupt handler is unable to stop the stall is fine, but the
normal case of interrupting cleanly should exit through main().

@torarnv
Copy link
Contributor Author

torarnv commented Apr 14, 2015

@whyrusleeping any 💭 ?

This reverts commit f74e71f.

The 'Online' flag of the command context does not seem to be set in
any code paths, at least not when running commands such as 'ipfs daemon'
or 'ipfs ping'. The result after f74e71f is that we never shutdown
cleanly, as we'll always os.Exit(0) from the interrupt handler.

The os.Exit(0) itself is also dubious, as conceptually the interrupt
handler should ask whatever is stalling to stop stalling, so that
main() can return like normal. Exiting with -1 in error cases where
the interrupt handler is unable to stop the stall is fine, but the
normal case of interrupting cleanly should exit through main().
@torarnv torarnv force-pushed the revert-online-check-in-interrupt-handler branch from 7a0169f to 17cfa53 Compare April 14, 2015 16:09
@torarnv torarnv mentioned this pull request Apr 14, 2015
@jbenet
Copy link
Member

jbenet commented Apr 14, 2015

@torarnv may want to just add the other commits fixing the original error in this same PR.

@torarnv
Copy link
Contributor Author

torarnv commented Apr 14, 2015

@jbenet okey, did that

@torarnv torarnv closed this Apr 14, 2015
@jbenet jbenet removed the backlog label Apr 14, 2015
@torarnv torarnv reopened this Apr 14, 2015
@jbenet jbenet added ready and removed ready labels Apr 14, 2015
@torarnv
Copy link
Contributor Author

torarnv commented Apr 14, 2015

Oh, you mean't fixing the "file "/Users/torarne/.go-ipfs/daemon.lock" already locked" stuff on top here

@jbenet
Copy link
Member

jbenet commented Apr 14, 2015

@torarnv just remembered #1037 -- we can do it either way. you lmk what you prefer. just the fix should go in here or in #1037

@whyrusleeping
Copy link
Member

@torarnv I just realized how wrong i was with that commit. My apologies for committing crappy code (daemon shutdown will never properly close a profile the way it is now)

@torarnv
Copy link
Contributor Author

torarnv commented Apr 17, 2015

@whyrusleeping Don't worry about it man! I was just a bit confused and wondering if I missed something obvious when trying to understand the logic 😃

@torarnv
Copy link
Contributor Author

torarnv commented Apr 17, 2015

I'll do this as part of #1037 instead

@torarnv torarnv closed this Apr 17, 2015
@jbenet jbenet removed the backlog label Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants