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

consumer: ConnectToNSQLookupd does not return error when nsqlookupd is not reachable #257

Closed
ayoubfaouzi opened this issue Apr 6, 2019 · 2 comments
Labels

Comments

@ayoubfaouzi
Copy link

Hello,

When trying to call ConnectToNSQLookupd, even if nsqlookupd is not reachable, the function will return nil. Is that the expected behavior ?

Thanks.

@ploxiln
Copy link
Member

ploxiln commented Apr 6, 2019

Thanks for moving this issue :)

Yes, this is expected behavior.

ConnectToNSQLookupd() only returns an error if it cannot parse the address argument, or if the consumer is in the wrong state (for example, no message handler added).

Then, this function primarily adds this address to a list, which is used to query (and, effectively, retry) periodically. It is typical to add a handful of nsqlookupd (3 or 5 or so). Occasionally one will have to reboot or something and the query will fail, but another will work. Then the one that failed will come back but another will be temporarily out of service. So this function is not really about connecting immediately, but about adding to a list to retry periodically.

@ayoubfaouzi
Copy link
Author

Hey @ploxiln,

I was specualting you did it for a purpose, I can see it now. Thanks for your detailed answer.

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

No branches or pull requests

2 participants