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

nsqlookupd: Main() has no way to expose its errors and calls os.Exit #1003

Closed
stephens2424 opened this issue Feb 28, 2018 · 1 comment · Fixed by #1004
Closed

nsqlookupd: Main() has no way to expose its errors and calls os.Exit #1003

stephens2424 opened this issue Feb 28, 2018 · 1 comment · Fixed by #1004
Labels

Comments

@stephens2424
Copy link

Using NSQ as a library, including lookupd, is a little tricky to handle error situations, like if you have something else on the same port. It doesn't expose the error beyond a log, and then it calls os.Exit, so importers have no chance to handle the error themselves and it brings down the rest of the program. (This caused a problem for me in test code, where I typically need defers to run to do some cleanup. :) )

I'm proposing a new top-level function that will perform most of what Main does now, but has a new name and returns errors instead of logging and exiting. That function could be named MainErr. Main, then, will call MainErr and then use the return value to recreate its current behavior.

stephens2424 pushed a commit to stephens2424/nsq that referenced this issue Feb 28, 2018
stephens2424 pushed a commit to stephens2424/nsq that referenced this issue Mar 2, 2018
@mreiferson
Copy link
Member

continued in #1004

stephens2424 pushed a commit to stephens2424/nsq that referenced this issue Mar 6, 2018
stephens2424 pushed a commit to stephens2424/nsq that referenced this issue Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants