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

exception " Index out of range" #89

Open
lonelywolf4git opened this issue Mar 9, 2019 · 1 comment
Open

exception " Index out of range" #89

lonelywolf4git opened this issue Mar 9, 2019 · 1 comment

Comments

@lonelywolf4git
Copy link

I use node-zookeeper-client to connect zookeeper which version is 3.4.1(docker), it sometimes throw the following exception "app.js:10
at checkOffset (buffer.js:972:11)
at Uint8Array.Buffer.readInt32BE (buffer.js:1137:5)
.....
at Array.forEach ()
at constructor.Record.deserialize
at ConnectionManager.onSocketData
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)

I add the console log here 👍
case 'buffer':
try {
length = buffer.readInt32BE(offset);
} catch (err) {
console.log("buffer's length is: " + buffer.length + " offset is " + offset)
throw err

        }

When throw it , I check the buffer length is 20, and offset is 20 too.
Can you help to check this ,thanks!

@rambo-panda
Copy link

It should have received abnormal data, right? In this case, it's best to close the socket and reconnect it?

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

No branches or pull requests

2 participants