{"action":"created","issue":{"url":"https://api.github.com/repos/garyburd/redigo/issues/130","labels_url":"https://api.github.com/repos/garyburd/redigo/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/garyburd/redigo/issues/130/comments","events_url":"https://api.github.com/repos/garyburd/redigo/issues/130/events","html_url":"https://github.com/garyburd/redigo/issues/130","id":92560433,"number":130,"title":"redis pool connect error  ","user":{"login":"ablegao","id":397045,"avatar_url":"https://avatars.githubusercontent.com/u/397045?v=3","gravatar_id":"","url":"https://api.github.com/users/ablegao","html_url":"https://github.com/ablegao","followers_url":"https://api.github.com/users/ablegao/followers","following_url":"https://api.github.com/users/ablegao/following{/other_user}","gists_url":"https://api.github.com/users/ablegao/gists{/gist_id}","starred_url":"https://api.github.com/users/ablegao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ablegao/subscriptions","organizations_url":"https://api.github.com/users/ablegao/orgs","repos_url":"https://api.github.com/users/ablegao/repos","events_url":"https://api.github.com/users/ablegao/events{/privacy}","received_events_url":"https://api.github.com/users/ablegao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-02T06:33:12Z","updated_at":"2015-07-28T07:10:36Z","closed_at":null,"body":"\r\n\r\nmy code:\r\n\r\n     \tclient := aorm.Pool.Get()\r\n\tdefer client.Close()\r\n\tmykeys := []string{}\r\n\tkey := \"nadostory:\" + strconv.Itoa(int(self.Uid)) + \":*\"\r\n\r\n\tif keys, err := redis.Strings(client.Do(\"KEYS\", key)); err == nil && len(keys) > 0 {\r\n\t\tfor _, k := range keys {\r\n\t\t\tmykeys = append(mykeys, k)\r\n\t\t}\r\n\t}\r\n\r\n\r\nerror:\r\n\r\npanic: runtime error: slice bounds out of range\r\n\r\ngoroutine 14 [running]:\r\nbufio.(*Reader).ReadSlice(0xc20825cf60, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n\t/opt/godev/src/bufio/bufio.go:273 +0x266\r\ngithub.com/garyburd/redigo/redis.(*conn).readLine(0xc2082fa140, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:228 +0x6d\r\ngithub.com/garyburd/redigo/redis.(*conn).readReply(0xc2082fa140, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:301 +0x66\r\ngithub.com/garyburd/redigo/redis.(*conn).Do(0xc2082fa140, 0xa6bb50, 0x4, 0xc2080f8300, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:447 +0x5c6\r\ngithub.com/garyburd/redigo/redis.(*pooledConnection).Do(0xc2082776a0, 0xa6bb50, 0x4, 0xc2080f8300, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/pool.go:365 +0xf0\r\nnado/userlib.UserApiInfo.Exit(0x7f5f7a96dbb0, 0xc208299e60, 0x0, 0x0, 0x0, 0x0, 0x0, 0xab54f0, 0x9, 0xc208299240, ...)\r\n\t/Users/gao/code/mygo/src/nado/userlib/struct_user_api.go:680 +0x278\r\nnado/room.UserClosedToBc(0x7f5f7a971aa0, 0xc2081f44d0, 0x10002, 0x14e4d4df1ab, 0x303ec000a, 0x275c, 0xc2082806c0, 0xe, 0x11, 0xc2082987c0, ...)\r\n\t/Users/gao/code/mygo/src/nado/room/processing_of_user_closed.go:52 +0x1354"},"comment":{"url":"https://api.github.com/repos/garyburd/redigo/issues/comments/125478394","html_url":"https://github.com/garyburd/redigo/issues/130#issuecomment-125478394","issue_url":"https://api.github.com/repos/garyburd/redigo/issues/130","id":125478394,"user":{"login":"ablegao","id":397045,"avatar_url":"https://avatars.githubusercontent.com/u/397045?v=3","gravatar_id":"","url":"https://api.github.com/users/ablegao","html_url":"https://github.com/ablegao","followers_url":"https://api.github.com/users/ablegao/followers","following_url":"https://api.github.com/users/ablegao/following{/other_user}","gists_url":"https://api.github.com/users/ablegao/gists{/gist_id}","starred_url":"https://api.github.com/users/ablegao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ablegao/subscriptions","organizations_url":"https://api.github.com/users/ablegao/orgs","repos_url":"https://api.github.com/users/ablegao/repos","events_url":"https://api.github.com/users/ablegao/events{/privacy}","received_events_url":"https://api.github.com/users/ablegao/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T07:10:36Z","updated_at":"2015-07-28T07:10:36Z","body":"==================\r\nWARNING: DATA RACE\r\nWrite by goroutine 12:\r\n  syscall.raceWriteRange()\r\n      /opt/godev/src/syscall/race.go:29 +0x40\r\n  syscall.Read()\r\n      /opt/godev/src/syscall/syscall_unix.go:139 +0xa4\r\n  net.(*netFD).Read()\r\n      /opt/godev/src/net/fd_unix.go:238 +0x3b7\r\n  net.(*conn).Read()\r\n      /opt/godev/src/net/net.go:121 +0x124\r\n  net.(*TCPConn).Read()\r\n      <autogenerated>:36 +0x85\r\n  bufio.(*Reader).fill()\r\n      /opt/godev/src/bufio/bufio.go:97 +0x381\r\n  bufio.(*Reader).ReadSlice()\r\n      /opt/godev/src/bufio/bufio.go:295 +0x60b\r\n  github.com/garyburd/redigo/redis.(*conn).readLine()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:228 +0x93\r\n  github.com/garyburd/redigo/redis.(*conn).readReply()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:301 +0x76\r\n  github.com/garyburd/redigo/redis.(*conn).Do()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:434 +0x544\r\n  github.com/garyburd/redigo/redis.(*pooledConnection).Close()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/pool.go:353 +0x4f8\r\n  github.com/server-nado/orm.(*RedisCache).ConnClose()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache_driver_redis.go:59 +0x7b\r\n  github.com/server-nado/orm.(*RedisCache).Hset()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache_driver_redis.go:96 +0x34e\r\n  github.com/server-nado/orm.(*CacheModule).Set()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache.go:267 +0x5e4\r\n  main.actLoadingMessage()\r\n      /Users/gao/code/mygo/src/codmaster/codconsumer/process_user_friends.go:90 +0x1840\r\n  github.com/server-nado/serve.NadoServer.RunHandler()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/nado_server.go:128 +0x2b7\r\n  github.com/server-nado/serve.RunHand()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/handler.go:67 +0x12e\r\n  github.com/server-nado/serve/socket-consumer-handler.func·001()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:33 +0x2de\r\n  github.com/server-nado/serve.ReadResponseByConnect()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/bytes.go:168 +0x2c4\r\n  github.com/server-nado/serve/socket-consumer-handler.(*NsqHandler).HandleMessage()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:35 +0x3d1\r\n  github.com/server-nado/go-nsq.(*Consumer).handlerLoop()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1094 +0x211\r\n\r\nPrevious read by goroutine 13:\r\n  github.com/garyburd/redigo/redis.(*conn).readReply()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:308 +0x1a2\r\n  github.com/garyburd/redigo/redis.(*conn).Do()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:447 +0x76e\r\n  github.com/garyburd/redigo/redis.(*pooledConnection).Do()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/pool.go:365 +0x161\r\n  github.com/server-nado/orm.(*RedisCache).Hmset()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache_driver_redis.go:108 +0x471\r\n  github.com/server-nado/orm.CacheModule.SaveToCache()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache.go:605 +0xa82\r\n  github.com/server-nado/orm.(*CacheModule).Save()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache.go:298 +0x2ff\r\n  main.actUserInfo()\r\n      /Users/gao/code/mygo/src/codmaster/codconsumer/process_userinfo.go:66 +0x5b4\r\n  github.com/server-nado/serve.NadoServer.RunHandler()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/nado_server.go:128 +0x2b7\r\n  github.com/server-nado/serve.RunHand()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/handler.go:67 +0x12e\r\n  github.com/server-nado/serve/socket-consumer-handler.func·001()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:33 +0x2de\r\n  github.com/server-nado/serve.ReadResponseByConnect()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/bytes.go:168 +0x2c4\r\n  github.com/server-nado/serve/socket-consumer-handler.(*NsqHandler).HandleMessage()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:35 +0x3d1\r\n  github.com/server-nado/go-nsq.(*Consumer).handlerLoop()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1094 +0x211\r\n\r\nGoroutine 12 (running) created at:\r\n  github.com/server-nado/go-nsq.(*Consumer).AddConcurrentHandlers()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1076 +0x103\r\n  github.com/server-nado/serve/socket-consumer-handler.(*SocketServer).Run()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/socket_handler.go:55 +0x8bd\r\n\r\nGoroutine 13 (running) created at:\r\n  github.com/server-nado/go-nsq.(*Consumer).AddConcurrentHandlers()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1076 +0x103\r\n  github.com/server-nado/serve/socket-consumer-handler.(*SocketServer).Run()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/socket_handler.go:55 +0x8bd\r\n==================\r\n==================\r\nWARNING: DATA RACE\r\nWrite by goroutine 12:\r\n  syscall.raceWriteRange()\r\n      /opt/godev/src/syscall/race.go:29 +0x40\r\n  syscall.Read()\r\n      /opt/godev/src/syscall/syscall_unix.go:139 +0xa4\r\n  net.(*netFD).Read()\r\n      /opt/godev/src/net/fd_unix.go:238 +0x3b7\r\n  net.(*conn).Read()\r\n      /opt/godev/src/net/net.go:121 +0x124\r\n  net.(*TCPConn).Read()\r\n      <autogenerated>:36 +0x85\r\n  bufio.(*Reader).fill()\r\n      /opt/godev/src/bufio/bufio.go:97 +0x381\r\n  bufio.(*Reader).ReadSlice()\r\n      /opt/godev/src/bufio/bufio.go:295 +0x60b\r\n  github.com/garyburd/redigo/redis.(*conn).readLine()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:228 +0x93\r\n  github.com/garyburd/redigo/redis.(*conn).readReply()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:301 +0x76\r\n  github.com/garyburd/redigo/redis.(*conn).Do()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:434 +0x544\r\n  github.com/garyburd/redigo/redis.(*pooledConnection).Close()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/pool.go:353 +0x4f8\r\n  github.com/server-nado/orm.(*RedisCache).ConnClose()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache_driver_redis.go:59 +0x7b\r\n  github.com/server-nado/orm.(*RedisCache).Hset()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache_driver_redis.go:96 +0x34e\r\n  github.com/server-nado/orm.(*CacheModule).Set()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache.go:267 +0x5e4\r\n  main.actLoadingMessage()\r\n      /Users/gao/code/mygo/src/codmaster/codconsumer/process_user_friends.go:90 +0x1840\r\n  github.com/server-nado/serve.NadoServer.RunHandler()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/nado_server.go:128 +0x2b7\r\n  github.com/server-nado/serve.RunHand()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/handler.go:67 +0x12e\r\n  github.com/server-nado/serve/socket-consumer-handler.func·001()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:33 +0x2de\r\n  github.com/server-nado/serve.ReadResponseByConnect()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/bytes.go:168 +0x2c4\r\n  github.com/server-nado/serve/socket-consumer-handler.(*NsqHandler).HandleMessage()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:35 +0x3d1\r\n  github.com/server-nado/go-nsq.(*Consumer).handlerLoop()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1094 +0x211\r\n\r\nPrevious read by goroutine 13:\r\n  runtime.slicebytetostring()\r\n      /opt/godev/src/runtime/string.go:62 +0x0\r\n  github.com/garyburd/redigo/redis.(*conn).readReply()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:318 +0xbbb\r\n  github.com/garyburd/redigo/redis.(*conn).Do()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/conn.go:447 +0x76e\r\n  github.com/garyburd/redigo/redis.(*pooledConnection).Do()\r\n      /Users/gao/code/mygo/src/github.com/garyburd/redigo/redis/pool.go:365 +0x161\r\n  github.com/server-nado/orm.(*RedisCache).Hmset()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache_driver_redis.go:108 +0x471\r\n  github.com/server-nado/orm.CacheModule.SaveToCache()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache.go:605 +0xa82\r\n  github.com/server-nado/orm.(*CacheModule).Save()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/orm/cache.go:298 +0x2ff\r\n  main.actUserInfo()\r\n      /Users/gao/code/mygo/src/codmaster/codconsumer/process_userinfo.go:66 +0x5b4\r\n  github.com/server-nado/serve.NadoServer.RunHandler()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/nado_server.go:128 +0x2b7\r\n  github.com/server-nado/serve.RunHand()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/handler.go:67 +0x12e\r\n  github.com/server-nado/serve/socket-consumer-handler.func·001()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:33 +0x2de\r\n  github.com/server-nado/serve.ReadResponseByConnect()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/bytes.go:168 +0x2c4\r\n  github.com/server-nado/serve/socket-consumer-handler.(*NsqHandler).HandleMessage()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/nsq_handler.go:35 +0x3d1\r\n  github.com/server-nado/go-nsq.(*Consumer).handlerLoop()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1094 +0x211\r\n\r\nGoroutine 12 (running) created at:\r\n  github.com/server-nado/go-nsq.(*Consumer).AddConcurrentHandlers()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1076 +0x103\r\n  github.com/server-nado/serve/socket-consumer-handler.(*SocketServer).Run()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/socket_handler.go:55 +0x8bd\r\n\r\nGoroutine 13 (running) created at:\r\n  github.com/server-nado/go-nsq.(*Consumer).AddConcurrentHandlers()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/go-nsq/consumer.go:1076 +0x103\r\n  github.com/server-nado/serve/socket-consumer-handler.(*SocketServer).Run()\r\n      /Users/gao/code/mygo/src/github.com/server-nado/serve/socket-consumer-handler/socket_handler.go:55 +0x8bd\r\n=================="}}