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

Connection error event never fired if Reader initialised with lookupdHTTPAddresses #309

Open
yangit opened this issue Sep 9, 2020 · 3 comments
Labels

Comments

@yangit
Copy link

yangit commented Sep 9, 2020

Hi,
If I initialise Reader with lookupdHTTPAddresses variable set to garbage

const reader = new nsq.Reader('test', 'test2', {
    lookupdHTTPAddresses: 'garbage:9999', 
});

const handler = () => {
    console.log('!!!handler fired!!');
    process.exit();
};
reader.on('error', handler);
reader.on('message', handler);
reader.on('discard', handler);
reader.on('nsqd_connected', handler);
reader.on('nsqd_closed', handler);

reader.connect();

The error event is never dispatched.

If I initialise with nsqdTCPAddresses it works as expected.
Is it a bug?

@dudleycarr
Copy link
Owner

I found the culprit:
https://github.com/dudleycarr/nsqjs/blob/master/lib/lookupd.js#L39

I'll get a fix in for that over the weekend.

@dudleycarr dudleycarr added the bug label Sep 10, 2020
@yangit
Copy link
Author

yangit commented Sep 11, 2020

Please check this line as well
https://github.com/dudleycarr/nsqjs/blob/master/lib/lookupd.js#L53
It seems to not pass the error down.

@smfreegard
Copy link

Bump - I've just hit this bug too.

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

3 participants