{"action":"created","issue":{"url":"https://api.github.com/repos/wandoulabs/codis/issues/266","labels_url":"https://api.github.com/repos/wandoulabs/codis/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/wandoulabs/codis/issues/266/comments","events_url":"https://api.github.com/repos/wandoulabs/codis/issues/266/events","html_url":"https://github.com/wandoulabs/codis/issues/266","id":87629014,"number":266,"title":"Jodis在程序启动和运行中出现的两个报错（not get resource 和 read time out）","user":{"login":"laizhihuan","id":1711748,"avatar_url":"https://avatars.githubusercontent.com/u/1711748?v=3","gravatar_id":"","url":"https://api.github.com/users/laizhihuan","html_url":"https://github.com/laizhihuan","followers_url":"https://api.github.com/users/laizhihuan/followers","following_url":"https://api.github.com/users/laizhihuan/following{/other_user}","gists_url":"https://api.github.com/users/laizhihuan/gists{/gist_id}","starred_url":"https://api.github.com/users/laizhihuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laizhihuan/subscriptions","organizations_url":"https://api.github.com/users/laizhihuan/orgs","repos_url":"https://api.github.com/users/laizhihuan/repos","events_url":"https://api.github.com/users/laizhihuan/events{/privacy}","received_events_url":"https://api.github.com/users/laizhihuan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-12T06:40:55Z","updated_at":"2015-06-12T06:50:45Z","closed_at":null,"body":"用了jodis，这两个报错，一个是jodisPool.getResource()报错，第二是超时；\r\n这两个报错，会在两个情况下出现\r\n1：程序启动时出现，但是第二次在重启时可能就不会重现了，并不是每次都出现，但是较为频繁；\r\n2：数据在读写时出现，并非压力极大的情况下出现，具有偶然性；\r\n\r\nPS：超时时间设置为15000\r\n\r\n第一个报错\r\n----------------------------------------------------------------------------------------------------------------------------\r\nredis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool\r\n\tat redis.clients.util.Pool.getResource(Pool.java:53)\r\n\tat redis.clients.jedis.JedisPool.getResource(JedisPool.java:99)\r\n\tat com.wandoulabs.jodis.RoundRobinJedisPool.getResource(RoundRobinJedisPool.java:288)\r\n\tat com.mokylin.common.db.RedisManager.getJedis(RedisManager.java:77)\r\n\tat com.mokylin.common.db.RedisManager.getHashByteData(RedisManager.java:182)\r\n\tat com.mokylin.game.manager.DBAccessManager.loadArenaRank(DBAccessManager.java:537)\r\n\tat com.mokylin.game.manager.ArenaCacheManager.load(ArenaCacheManager.java:87)\r\n\tat com.mokylin.game.GameService.startServer(GameService.java:52)\r\n\tat com.mokylin.game.GameServer.startServer(GameServer.java:41)\r\n\tat com.mokylin.game.GameServer.parseAndExec(GameServer.java:27)\r\n\tat com.mokylin.game.GameServer.main(GameServer.java:19)\r\nCaused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out\r\n\tat redis.clients.jedis.Connection.connect(Connection.java:150)\r\n\tat redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)\r\n\tat redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1797)\r\n\tat redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:70)\r\n\tat org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:836)\r\n\tat org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:434)\r\n\tat org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:361)\r\n\tat redis.clients.util.Pool.getResource(Pool.java:51)\r\n\t... 10 more\r\nCaused by: java.net.SocketTimeoutException: connect timed out\r\n\tat java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)\r\n\tat java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)\r\n\tat java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)\r\n\tat java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)\r\n\tat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)\r\n\tat java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)\r\n\tat java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)\r\n\tat java.net.Socket.connect(Socket.java:579)\r\n\tat redis.clients.jedis.Connection.connect(Connection.java:144)\r\n\t... 17 more\r\n-------------------------------------------------------------------------------------------------------------------------------\r\n第二个报错\r\n-------------------------------------------------------------------------------------------------------------------------------\r\nredis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out\r\n\tat redis.clients.jedis.Protocol.process(Protocol.java:146)\r\n\tat redis.clients.jedis.Protocol.read(Protocol.java:202)\r\n\tat redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:285)\r\n\tat redis.clients.jedis.Connection.getIntegerReply(Connection.java:210)\r\n\tat redis.clients.jedis.BinaryJedis.llen(BinaryJedis.java:1055)\r\n\tat com.mokylin.common.db.RedisManager.getByteListData(RedisManager.java:328)\r\n\tat com.mokylin.common.db.RedisManager.clearByteList(RedisManager.java:272)\r\n\tat com.mokylin.game.manager.WordBossManager.save2Redis(WordBossManager.java:189)\r\n\tat com.mokylin.game.manager.WordBossManager.access$0(WordBossManager.java:186)\r\n\tat com.mokylin.game.manager.WordBossManager$2.run(WordBossManager.java:235)\r\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)\r\n\tat java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)\r\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)\r\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.net.SocketTimeoutException: Read timed out\r\n\tat java.net.SocketInputStream.socketRead0(Native Method)\r\n\tat java.net.SocketInputStream.read(SocketInputStream.java:152)\r\n\tat java.net.SocketInputStream.read(SocketInputStream.java:122)\r\n\tat java.net.SocketInputStream.read(SocketInputStream.java:108)\r\n\tat redis.clients.util.RedisInputStream.fill(RedisInputStream.java:109)\r\n\tat redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:45)\r\n\tat redis.clients.jedis.Protocol.process(Protocol.java:131)\r\n\t... 16 more\r\n"},"comment":{"url":"https://api.github.com/repos/wandoulabs/codis/issues/comments/111382855","html_url":"https://github.com/wandoulabs/codis/issues/266#issuecomment-111382855","issue_url":"https://api.github.com/repos/wandoulabs/codis/issues/266","id":111382855,"user":{"login":"IceiceFire","id":12807288,"avatar_url":"https://avatars.githubusercontent.com/u/12807288?v=3","gravatar_id":"","url":"https://api.github.com/users/IceiceFire","html_url":"https://github.com/IceiceFire","followers_url":"https://api.github.com/users/IceiceFire/followers","following_url":"https://api.github.com/users/IceiceFire/following{/other_user}","gists_url":"https://api.github.com/users/IceiceFire/gists{/gist_id}","starred_url":"https://api.github.com/users/IceiceFire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IceiceFire/subscriptions","organizations_url":"https://api.github.com/users/IceiceFire/orgs","repos_url":"https://api.github.com/users/IceiceFire/repos","events_url":"https://api.github.com/users/IceiceFire/events{/privacy}","received_events_url":"https://api.github.com/users/IceiceFire/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T06:50:45Z","updated_at":"2015-06-12T06:50:45Z","body":"pool连接数量，哪里设定jodis里吗？\n\n通过我的 Moto X Pro 发送\n\n2015年6月12日 下午2:44于 Phil Yang <notifications@github.com>写道：\n第一个问题可以试着把pool的连接数开大一些？或者延长getResource的超时时间\n\n---\nReply to this email directly or view it on GitHub:\nhttps://github.com/wandoulabs/codis/issues/266#issuecomment-111381967\n"}}