{"action":"created","issue":{"url":"https://api.github.com/repos/vert-x/mod-redis/issues/26","labels_url":"https://api.github.com/repos/vert-x/mod-redis/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/vert-x/mod-redis/issues/26/comments","events_url":"https://api.github.com/repos/vert-x/mod-redis/issues/26/events","html_url":"https://github.com/vert-x/mod-redis/issues/26","id":45267761,"number":26,"title":"hgetall fails on key with large number of fields","user":{"login":"nsheard","id":7429868,"avatar_url":"https://avatars.githubusercontent.com/u/7429868?v=3","gravatar_id":"","url":"https://api.github.com/users/nsheard","html_url":"https://github.com/nsheard","followers_url":"https://api.github.com/users/nsheard/followers","following_url":"https://api.github.com/users/nsheard/following{/other_user}","gists_url":"https://api.github.com/users/nsheard/gists{/gist_id}","starred_url":"https://api.github.com/users/nsheard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsheard/subscriptions","organizations_url":"https://api.github.com/users/nsheard/orgs","repos_url":"https://api.github.com/users/nsheard/repos","events_url":"https://api.github.com/users/nsheard/events{/privacy}","received_events_url":"https://api.github.com/users/nsheard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vert-x/mod-redis/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-10-08T16:48:37Z","updated_at":"2015-07-05T01:13:41Z","closed_at":"2015-06-29T20:30:59Z","body":"Hi,\r\n\r\nI've run into an issue with mod-redis 1.1.4 where if I attempt to do a hgetall on a key with a large number of fields it fails with various exceptions.  I initially saw the issue in some code with only about 15 fields, but have written this test code that demonstrates the issue:\r\n\r\n```\r\nfinal String testKey = \"testKey\";\r\nJsonObject command = new JsonObject();\r\ncommand.putString(\"command\", \"hmset\");\r\n\r\nJsonArray args = new JsonArray();\r\nargs.add(testKey);\r\nfor (int i=0; i<100; i++) {\r\n    args.add(\"field\"+i);\r\n    args.add(\"1234567890\");\r\n}\r\ncommand.putArray(\"args\", args);\r\n\t\t\t    \r\nvertx.eventBus().send(\"my.redis\", command, new Handler<Message<JsonObject>>() {\r\n    @Override\r\n    public void handle(Message<JsonObject> result) {\r\n        //key should be stored\r\n\t\t\t\t\t\r\n        //now hgetall the key\r\n        JsonObject command = new JsonObject();\r\n        JsonArray args = new JsonArray();\r\n        args.add(testKey);\r\n        command.putString(\"command\", \"hgetall\");\r\n        command.putArray(\"args\", args);\r\n\t\t\t\t\t    \r\n        vertx.eventBus().send(\"my.redis\", command, new Handler<Message<JsonObject>>() {\r\n            @Override\r\n            public void handle(Message<JsonObject> result) {\r\n                //never get here - lots of exceptions output instead!!!\r\n            }\r\n        });\r\n    }\r\n});\r\n```\r\n\r\nThe exact number of fields that it fails at seems to vary.  The exceptions generated are along the lines of:\r\n```\r\nSEVERE: Exception in Java verticle\r\njava.lang.IndexOutOfBoundsException: index: 2049 (expected: range(0, 2048))\r\n\tat io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1118)\r\n\tat io.netty.buffer.AbstractByteBuf.getByte(AbstractByteBuf.java:331)\r\n\tat io.netty.buffer.WrappedByteBuf.getByte(WrappedByteBuf.java:205)\r\n\tat org.vertx.java.core.buffer.Buffer.getByte(Buffer.java:115)\r\n\tat io.vertx.redis.ReplyParser.parseResult(ReplyParser.java:100)\r\n\tat io.vertx.redis.ReplyParser.handle(ReplyParser.java:141)\r\n\tat io.vertx.redis.ReplyParser.handle(ReplyParser.java:7)\r\n\tat org.vertx.java.core.net.impl.DefaultNetSocket.handleDataReceived(DefaultNetSocket.java:237)\r\n\tat org.vertx.java.core.net.impl.VertxNetHandler.channelRead(VertxNetHandler.java:47)\r\n\tat org.vertx.java.core.net.impl.VertxNetHandler.channelRead(VertxNetHandler.java:31)\r\n\tat org.vertx.java.core.net.impl.VertxHandler.channelRead(VertxHandler.java:155)\r\n\tat io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338)\r\n\tat io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324)\r\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)\r\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)\r\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)\r\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)\r\n\tat java.lang.Thread.run(Thread.java:722)\r\n```\r\nfollowed by several along the lines of:\r\n```\r\nSEVERE: Exception in Java verticle\r\njava.lang.RuntimeException: Received a non pub/sub message without reply handler waiting:field69\r\n\tat io.vertx.redis.RedisConnection.handleReply(RedisConnection.java:262)\r\n\tat io.vertx.redis.ReplyParser.handle(ReplyParser.java:147)\r\n\tat io.vertx.redis.ReplyParser.handle(ReplyParser.java:7)\r\n\tat org.vertx.java.core.net.impl.DefaultNetSocket.handleDataReceived(DefaultNetSocket.java:237)\r\n\tat org.vertx.java.core.net.impl.VertxNetHandler.channelRead(VertxNetHandler.java:47)\r\n\tat org.vertx.java.core.net.impl.VertxNetHandler.channelRead(VertxNetHandler.java:31)\r\n\tat org.vertx.java.core.net.impl.VertxHandler.channelRead(VertxHandler.java:155)\r\n\tat io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338)\r\n\tat io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324)\r\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)\r\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:126)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452)\r\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)\r\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)\r\n\tat java.lang.Thread.run(Thread.java:722)\r\n```\r\nI've tried re-writing the code using RedisClient and experience the same issue.\r\n\r\nLooks to me like the response from Redis is being broken up into several messages and not handled correctly (just a guess).\r\n\r\nAny suggestions would be greatly appreciated as without this working I'm not going to be able to use mod-redis.\r\n\r\nMany Thanks"},"comment":{"url":"https://api.github.com/repos/vert-x/mod-redis/issues/comments/118568179","html_url":"https://github.com/vert-x/mod-redis/issues/26#issuecomment-118568179","issue_url":"https://api.github.com/repos/vert-x/mod-redis/issues/26","id":118568179,"user":{"login":"smiklosovic","id":588603,"avatar_url":"https://avatars.githubusercontent.com/u/588603?v=3","gravatar_id":"","url":"https://api.github.com/users/smiklosovic","html_url":"https://github.com/smiklosovic","followers_url":"https://api.github.com/users/smiklosovic/followers","following_url":"https://api.github.com/users/smiklosovic/following{/other_user}","gists_url":"https://api.github.com/users/smiklosovic/gists{/gist_id}","starred_url":"https://api.github.com/users/smiklosovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smiklosovic/subscriptions","organizations_url":"https://api.github.com/users/smiklosovic/orgs","repos_url":"https://api.github.com/users/smiklosovic/repos","events_url":"https://api.github.com/users/smiklosovic/events{/privacy}","received_events_url":"https://api.github.com/users/smiklosovic/received_events","type":"User","site_admin":false},"created_at":"2015-07-05T01:13:41Z","updated_at":"2015-07-05T01:13:41Z","body":"why have you closed this?"}}