Git Product home page Git Product logo

Comments (6)

mathieucarbou avatar mathieucarbou commented on July 24, 2024

Jedis: 1.5.0
Redis: redis-2.2.0-rc2.tar.gz

from jedis.

yaourt avatar yaourt commented on July 24, 2024

You need to configure the pool with "testOnBorrow = true" ...
Redis server is shuting down the connections after a while, and you need to test if the connection is still useable on the client side ...

from jedis.

mathieucarbou avatar mathieucarbou commented on July 24, 2024

Thank you it works!

from jedis.

nafeger avatar nafeger commented on July 24, 2024

Just to beat a dead horse a bit, might a good pool setup for a long running server process be as simple as:

JedisPoolConfig config = new JedisPoolConfig();
config.setTestOnBorrow(true);
this.pool = new JedisPool(config, this.redisServer, this.redisPort);

from jedis.

willzhai avatar willzhai commented on July 24, 2024

when i use redis-2.2.2 and jedis-1.5.2

static {
if (pool == null) {
redis.clients.jedis.JedisPoolConfig config = new redis.clients.jedis.JedisPoolConfig();
config.maxActive = 20;
config.maxIdle = 10;
config.maxWait = 1000;
config.testOnBorrow = true;
pool = new JedisPool(config, REDISHOST, REDISPORT);
}
}

i got the following and do not know why,~~~~(>_<)~~~~ :

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

java.util.NoSuchElementException: Could not create a validated object, cause: ValidateObject failed org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1203)
redis.clients.util.Pool.getResource(Pool.java:20)

from jedis.

yychaoV5 avatar yychaoV5 commented on July 24, 2024

jedis with some error: when redis server send back "Protocol error" message , the server will close socket; but jedis Protocol.java just throw a JedisDataException exception and ignored tcp close segment; so if you reuse this connection, jedis will throw an exception with "It seems like server has closed the connection" message.

from jedis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.