{"action":"created","issue":{"url":"https://api.github.com/repos/alexguan/node-zookeeper-client/issues/39","labels_url":"https://api.github.com/repos/alexguan/node-zookeeper-client/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/alexguan/node-zookeeper-client/issues/39/comments","events_url":"https://api.github.com/repos/alexguan/node-zookeeper-client/issues/39/events","html_url":"https://github.com/alexguan/node-zookeeper-client/issues/39","id":126859521,"number":39,"title":"node crashes when zookeeper sends an empty message","user":{"login":"david-knipe-hp","id":7872595,"avatar_url":"https://avatars.githubusercontent.com/u/7872595?v=3","gravatar_id":"","url":"https://api.github.com/users/david-knipe-hp","html_url":"https://github.com/david-knipe-hp","followers_url":"https://api.github.com/users/david-knipe-hp/followers","following_url":"https://api.github.com/users/david-knipe-hp/following{/other_user}","gists_url":"https://api.github.com/users/david-knipe-hp/gists{/gist_id}","starred_url":"https://api.github.com/users/david-knipe-hp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-knipe-hp/subscriptions","organizations_url":"https://api.github.com/users/david-knipe-hp/orgs","repos_url":"https://api.github.com/users/david-knipe-hp/repos","events_url":"https://api.github.com/users/david-knipe-hp/events{/privacy}","received_events_url":"https://api.github.com/users/david-knipe-hp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-15T11:56:14Z","updated_at":"2016-01-17T08:49:00Z","closed_at":null,"body":"I'm using node-zookeeper-client version 0.2.1. I've got the following stacktrace:\r\n\r\nError: offset: 4 is out of buffer range.\r\n\tat Record.deserialize (/opt/Autonomy/shared/zookeeper-ext/node_modules/node-zookeeper-client/lib/jute/index.js:465:15)\r\n\tat ConnectionManager.onSocketData (/opt/Autonomy/shared/zookeeper-ext/node_modules/node-zookeeper-client/lib/ConnectionManager.js:456:34)\r\n\tat ConnectionManager.onSocketData (/opt/Autonomy/shared/zookeeper-ext/node_modules/node-zookeeper-client/lib/ConnectionManager.js:580:14)\r\n\tat Socket.EventEmitter.emit (events.js:95:17)\r\n\tat Socket.<anonymous> (_stream_readable.js:745:14)\r\n\tat Socket.EventEmitter.emit (events.js:92:17)\r\n\tat emitReadable_ (_stream_readable.js:407:10)\r\n\tat emitReadable (_stream_readable.js:403:5)\r\n\tat readableAddChunk (_stream_readable.js:165:9)\r\n\tat Socket.Readable.push (_stream_readable.js:127:10)\r\n\tat TCP.onread (net.js:528:21)\r\n\r\nIt seems zookeeper is sending an empty message which causes the client to throw. I don't think throwing an exception is the right thing to do just because a separate process gave you some data you didn't like. Especially since the exception is thrown from a handler and therefore can't be caught by the code that's calling node-zookeeper-client. And especially since (AFAICT) the interface with the server isn't documented.\r\n\r\nThis happened just after we briefly lost contact with the zookeeper server. I believe that https://issues.apache.org/jira/browse/ZOOKEEPER-1437 addresses the same server-side bug (but in a completely different client)."},"comment":{"url":"https://api.github.com/repos/alexguan/node-zookeeper-client/issues/comments/172301885","html_url":"https://github.com/alexguan/node-zookeeper-client/issues/39#issuecomment-172301885","issue_url":"https://api.github.com/repos/alexguan/node-zookeeper-client/issues/39","id":172301885,"user":{"login":"alexguan","id":165861,"avatar_url":"https://avatars.githubusercontent.com/u/165861?v=3","gravatar_id":"","url":"https://api.github.com/users/alexguan","html_url":"https://github.com/alexguan","followers_url":"https://api.github.com/users/alexguan/followers","following_url":"https://api.github.com/users/alexguan/following{/other_user}","gists_url":"https://api.github.com/users/alexguan/gists{/gist_id}","starred_url":"https://api.github.com/users/alexguan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexguan/subscriptions","organizations_url":"https://api.github.com/users/alexguan/orgs","repos_url":"https://api.github.com/users/alexguan/repos","events_url":"https://api.github.com/users/alexguan/events{/privacy}","received_events_url":"https://api.github.com/users/alexguan/received_events","type":"User","site_admin":false},"created_at":"2016-01-17T08:49:00Z","updated_at":"2016-01-17T08:49:00Z","body":"Could you tell me a little bit more of how to reproduce it? Which version of zookeeper are you using? What's the size of your zookeeper quorum? "}}