-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
nsqd/nsqlookupd: properly handle fatal accept errors #1140
Conversation
29b1580
to
2d41590
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a pass at this, I think we can make this a slightly smaller set of changes and still achieve the desired result.
2d41590
to
1ee8ecc
Compare
/ping @ploxiln @mreiferson. PTAL. :) |
it looks to me like, after all this, we ended up with something equivalent to #1138 (comment) (check if already doing exit, call |
Indeed, thank you for pointing that out. I still feel like the application (not I'm going to try to modify this PR on my own to see if I can get it to a place where I'm reasonably happy with it and then we can discuss. |
I do have one more idea: send |
1ee8ecc
to
47c0c54
Compare
pushed up my changes, if this seems reasonable I'll apply the same approach to |
(it does not yet even compile, mostly due to logging related bullshit) |
|
Yea, for sure, I'll clean all that up. I think the semantics of it being synchronous make more sense to me. I've come around to the idea that libraries shouldn't try to own concurrency in this way, and we've made this mistake in a few places (mostly thinking go-nsq). Also, we've never promised an API guarantee for |
I do like the "return err instead of just os.Exit(1)" pattern |
This is what i think, also. This way we do not need to any api. |
b8c5a14
to
35a127f
Compare
This way looks OK to me. |
Deeper down the rabbit hole... Commit d6b87a5 improves how Commit 76f3702 should start to fix tests, which required moving some initializing to |
69be08a
to
2c5e657
Compare
Finally have a green test run, PTAL and I'll clean up these commits. |
|
Sonofa! Thanks, will fix. |
599e6c0
to
5b58d22
Compare
OK, cleaned up the commits 🙏 |
As far as I can tell, this is pretty good. It's not easy to trigger the failure paths ... this is as far as I got with very low ulimit and parallel http requests:
|
other than that 👍 |
5b58d22
to
9d332eb
Compare
if env.IsWindowsService() { | ||
dir := filepath.Dir(os.Args[0]) | ||
return os.Chdir(dir) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mreiferson It doesn't hurt anything to have this, but the package does this bit for you now. I generally consider it impolite to os.Chdir
but in this case I thought it was warranted. https://github.com/judwhite/go-svc/blame/d83e900e4a688aad49f41263bebf8793f0bf6add/svc/svc_windows.go#L59-L66
#1138