Unexpected end of stream after 6 minutes of pending job

117 views
Skip to first unread message

Bertrand

unread,
May 19, 2015, 12:01:57 PM5/19/15
to redi...@googlegroups.com
Hello,

I am new to Redis, everything works well except when I am waiting too much time between two calls to Redis, I am getting an unexpected end of stream ...
Here is the sample code :

JedisPoolConfig conf = new JedisPoolConfig();
pool = new JedisPool(conf, REDIS_HOST, REDIS_PORT, 0, REDIS_PWD);
Jedis jedis = pool.getResource();
try {
  while (true) {
jedis.incr("test18");
        Thread.sleep(1000 * 60 * 6); // some pending job ...
  }
} catch (Exception e) {
  e.printStackTrace();
}

I tried to use setMinEvictableIdleTimeMillis and setTimeBetweenEvictionRunsMillis without any success ...
Is there a way to extend this time limit ? could it be a server side parameter ?

Thanks

Best Regards
Bertrand

Josiah Carlson

unread,
May 20, 2015, 12:59:03 AM5/20/15
to redi...@googlegroups.com
There should be both client and server-side timeout parameters. On the server side, it's the "timeout" configuration option, which defaults to 0 (no timeout). Check your server config with "CONFIG GET timeout". 

Looking around at Jedis, this merged pull request [1] offers several methods for setting the Jedis pool timeout for connections, which historically defaults to 2000ms.


 - Josiah


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages