xetorthio/jedis — Issue #261: Could not get a resource from the pool
Author: SamPeng87
Created: 2012-03-06 09:51:43+00:00
State: open

red is working netty service

service starting before:
JedisPoolConfig config = new JedisPoolConfig();
config.setMaxActive(300);
config.setMaxIdle(200);
config.setMaxWait(200);
config.setMinIdle(100);
jedisPool = new JedisPool(config, "localhost");

service running many access happen this error:

2012-3-6 17:49:01 org.jboss.netty.channel.SimpleChannelHandler
警告: EXCEPTION, please implement thrift.ThriftServerHandler.exceptionCaught() for proper handling.
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at redis.clients.util.Pool.getResource(Pool.java:22)
at com.e2work.helper.redis.SystemInfo.getMysqlInfo(SystemInfo.java:19)
at com.e2work.api.impl.SystemService.getMysqlInfo(SystemService.java:21)
at com.e2work.api.System$Processor$getMysqlInfo.getResult(System.java:165)
at com.e2work.api.System$Processor$getMysqlInfo.getResult(System.java:1)

this function is:
public Map getMysqlInfo(int insId){
Jedis redis=redisPool.getResource();
Map result = redis.hgetAll(System.INSTANCE_MYSQL_INFO.replace("%s", ""+insId));
redisPool.returnResource(redis);
return result;
}