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: pass defaults from opts into flags #837

Merged
merged 1 commit into from
Dec 29, 2016

Conversation

mreiferson
Copy link
Member

This updates nsqlookupd so that default values from the options struct
are passed into flag defaults since all flag values implement flag.Getter
and the recent change to go-options (mreiferson/go-options#15) was insufficient.

RFR @jehiah
cc @ploxiln

Fixes #826

@mreiferson mreiferson added the bug label Dec 29, 2016
@ploxiln
Copy link
Member

ploxiln commented Dec 29, 2016

I can confirm that this fixes the default broadcast address for nsqlookupd.

Check out the interface specifier on that ipv6 link-local address (it's pretty cool that this ipv6 stuff works):

[nsqlookupd] 2016/12/29 01:53:56.504125 200 GET /channels?topic=t1 ([fe80::3e15:c2ff:fec0:28a8%en0]:50923) 9.42µs

I'll separately look into why there was no error printed when no nsqlookupd could be contacted.

@mreiferson
Copy link
Member Author

I'll separately look into why there was no error printed when no nsqlookupd could be contacted.

When nsqlookupd returned an empty broadcast address nsqd would skip it entirely, see https://github.com/nsqio/nsq/blob/master/nsqd/lookup.go#L188

@ploxiln
Copy link
Member

ploxiln commented Dec 29, 2016

Yeah I figured something like that.

Options I was thinking of:

  • log error if there was at least one lookupd address configured, but none could be contacted
  • log error if broadcast address is empty (right where you point out)
  • just use tcp address (without port) if blank broadcast address

Copy link
Member

@ploxiln ploxiln left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes my test case

@mreiferson
Copy link
Member Author

@jehiah 🍏 💚 📗

@jehiah jehiah merged commit a811d02 into nsqio:master Dec 29, 2016
@mreiferson mreiferson deleted the nsqlookupd-flag-defaults branch March 22, 2017 04:18
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 this pull request may close these issues.

3 participants