-
Notifications
You must be signed in to change notification settings - Fork 75
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
ReaderRdy.balance leads some uncaughtExceptions: "TypeError: Cannot read property 'bump/setConnectionRdyMax' of undefined" #99
Comments
Are you listening for the error event on the the Reader? If not, it's On Tuesday, April 19, 2016, Chunlin Li notifications@github.com wrote:
|
Yes, I listened the error event.
And, the uncaughtException is not from an ErrorEvent. so I think I cannot catch the error by try catch or by add error listener on something. |
Do you have a full example I could see? On Tuesday, April 19, 2016, Chunlin Li notifications@github.com wrote:
|
This is my code. And I noticed, before every uncaughtException, there is a NSQD_CLOSED event been triggered.
|
It might be a bug with a connection that has gone missing and messages in- On Apr 19 2016, at 5:36 am, Chunlin Li <notifications@github.com> wrote:
|
Thank you for your rapid response, I will follow the progress. |
@Chunlin-Li Could your run your sample program with |
@dudleycarr |
@dudleycarr |
@dudleycarr |
I'm seeing this issue right now too. Any chance we can get a fix for it? |
@ekristen Sorry about the delay. I don't have time at the moment, but probably some time over thanksgiving to investigate. |
@dudleycarr ok, this is a pretty critical bug, its not catch-able and crashes my app frequently. Could you not simply add a check to ensure that the connection object is valid before referencing the function/property. |
@dudleycarr thoughts? |
Finally have some free time! Will investigate. Thanks for the ping.
…On Wed, Dec 21, 2016 at 12:10 PM Erik Kristensen ***@***.***> wrote:
@dudleycarr <https://github.com/dudleycarr> thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANWySfB3rbgCfNYkqIwg5zJX7oxa5pbks5rKYezgaJpZM4IKgAk>
.
|
Thanks @dudleycarr its happening more frequent one one of my apps, not entirely sure why though, here is the latest stack trace ... /opt/node_modules/nsqjs/lib/readerrdy.js:509
_results.push(this.connections[i].bump());
^
TypeError: Cannot read property 'bump' of undefined
at ReaderRdy.balance (/opt/node_modules/nsqjs/lib/readerrdy.js:509:44)
at NSQDConnection.<anonymous> (/opt/node_modules/nsqjs/lib/readerrdy.js:373:20)
at emitNone (events.js:91:20)
at NSQDConnection.emit (events.js:185:7)
at ConnectionState.Enter (/opt/node_modules/nsqjs/lib/nsqdconnection.js:579:19)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)
at callback (/opt/node_modules/node-state/lib/nodestate.js:84:32)
at ConnectionState.* (/opt/node_modules/nsqjs/lib/nsqdconnection.js:590:16)
at ConnectionState.NodeState.goto (/opt/node_modules/node-state/lib/nodestate.js:90:16) |
@ekristen I'm having a tough time reproducing this issue. It looks like the array of connections state management is busted in some way. The offending line is here: It would be really helpful if you could print out what the |
Eric,
The stack trace doesn't help me debug the state. Did the previous
suggestions make sense about how to get more debugging info?
It would also be really useful to see what's in the nsqd logs at the time
of the exception.
…On Wed, Dec 21, 2016 at 2:29 PM Erik Kristensen ***@***.***> wrote:
Thanks @dudleycarr <https://github.com/dudleycarr> its happening more
frequent one one of my apps, not entirely sure why though, here is the
latest stack trace ...
/opt/node_modules/nsqjs/lib/readerrdy.js:509
_results.push(this.connections[i].bump());
^
TypeError: Cannot read property 'bump' of undefined
at ReaderRdy.balance (/opt/node_modules/nsqjs/lib/readerrdy.js:509:44)
at NSQDConnection.<anonymous> (/opt/node_modules/nsqjs/lib/readerrdy.js:373:20)
at emitNone (events.js:91:20)
at NSQDConnection.emit (events.js:185:7)
at ConnectionState.Enter (/opt/node_modules/nsqjs/lib/nsqdconnection.js:579:19)
at emitOne (events.js:96:13)
at EventEmitter.emit (events.js:188:7)
at callback (/opt/node_modules/node-state/lib/nodestate.js:84:32)
at ConnectionState.* (/opt/node_modules/nsqjs/lib/nsqdconnection.js:590:16)
at ConnectionState.NodeState.goto (/opt/node_modules/node-state/lib/nodestate.js:90:16)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANWyad1N8S4WHFL2Jg7YuMBnnPQf52Eks5rKahDgaJpZM4IKgAk>
.
|
I can't reproduce it either, but I have an app that seems to trigger it at least daily, if not more. I'll try and get some console.log statements in there tonight and see if I can't have something by tomorrow morning for you. I would be happy if we could make this error catchable in the mean time though too. |
Can you tell me a bit more about the topology of your nsq setup? How many
messages do the workers handle before running into this issue on average?
…On Wed, Dec 21, 2016 at 5:43 PM Erik Kristensen ***@***.***> wrote:
I can't reproduce it either, but I have an app that seems to trigger it at
least daily, if not more. I'll try and get some console.log statements in
there tonight and see if I can't have something by tomorrow morning for you.
I would be happy if we could make this error catchable in the mean time
though too.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANWyUR3kjAojblXeqb1si9ATJV6JyUCks5rKdXUgaJpZM4IKgAk>
.
|
3 nsqd nodes, multiple workers, but in-flight is set to 1 (yes we know this is against recommended practices, but can't be avoided) As for the number of messages, I can try and figure that out. I'm modifying the app right now to add in a console log on the connections array. Will let you know as soon as I see the crash again. |
Here is the connection from the code being console.logged as well as the connections array.
|
@ekristen That was helpful! I think I found the issue! Basically, it needs the following at the top: return if @connections.length is 0 Could you please try that and let me know what you find? |
Hey @dudleycarr somehow I missed this message, I'll get it added shortly and see how the next few days progress. |
@ekristen Any luck with this issue? |
@dudleycarr I'm in the middle of testing this right now. I see you've been doing a lot of updates to your code too, any chance you want to just drop this fix in while you are at it? |
@ekristen Happy to do so. I was never able to reproduce this issue. Any chance the fix previously mentioned help solve the problem? |
Unless I put it in the wrong spot it doesn't seem to help. I guess I could just check to make sure |
I create some nsq.Reader as consumers, they works well but when some network error occurs, it has chance to crash my process.
I have several node process, each of them subscribe several topics from one same channel.
node version: v4.3.1
nsqjs version: v0.7.12
Error information:
Can you tell me how to fix this issue? really thank you!
The text was updated successfully, but these errors were encountered: