-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe #848
Comments
@gauravparmar85 I think this problem was fixed by PR #651 and reported by issue #636 Can you upgrade to version 2.5.1 and test again? |
@nykolaslima Unfortunately, it seems to not related to issue/PR you stated. It was ArrayIndexOutOfRangeException. |
@HeartSaVioR Actually the scenario is, I have this job configured using spring cron and it runs once in 24 hours to create some report from the data that i keep in redis DB. I works fine for the first time when i create the JedisPool but starts failing after that. |
Thanks all for your help. Modifying the pool config fixed this issue. |
@gauravparmar85 I am getting the same error, Can you please help me what exactly you changed/added in pool config to fix this problem. |
@gauravparmar85 : Hey, can you share the changes done in the pool config. I am facing the same error. |
@gauravparmar85 , guy, could you share the pool config fixed the issue? I have the same problem. |
I encountered the same error, my code is as follows, and I use jdk 1.8 There is a guy said change the redis config can solve this problem. Can any one find out which config to change? |
@elvis9xu he said that a pool config solved the issue, not a redis config. Maybe @gauravparmar85 can provide further info. |
Just had a similar issue and setting the test on borrow to true did the trick. I have a hunch that's what gauravparmar85 meant when he wrote "Thanks all for your help. Modifying the pool config fixed this issue" and vanished forever LOL :) poolConfig.setTestOnBorrow(true); |
I just restarted my server which was using |
yeah,I do restart my app which is useing jedis, and it fixed. |
建议生产环境都使用带poolConfig的构造方法,防止redis出现链接异常,可参考 bug redis/jedis#848
The issue cause by your connection was out at the moment, you need to connect again. |
Hi I am using Jedis 2.4.2 and i am getting this exception almost every time I make a call.
I am initializing jedis pool as
JedisPool jedisPool = new JedisPool(config, uri.getHost(), uri.getPort(), 10000);
and trying to get keys using
public Set keySet(String pattern) {
boolean valid = true;
Jedis jedis = jedisPool.getResource();
try {
auth(jedis);
return jedis.keys(defaultKeyPrefix + pattern);
} catch (JedisException e) {
valid = false;
logger.warn("Redis read exception", e);
} finally {
if (valid) {
jedisPool.returnResource(jedis);
} else {
jedisPool.returnBrokenResource(jedis);
}
}
return null;
}
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
at redis.clients.jedis.Connection.flush(Connection.java:70)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:210)
at redis.clients.jedis.Jedis.keys(Jedis.java:186)
..few more
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:111)
at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at redis.clients.util.RedisOutputStream.flushBuffer(RedisOutputStream.java:31)
at redis.clients.util.RedisOutputStream.flush(RedisOutputStream.java:223)
at redis.clients.jedis.Connection.flush(Connection.java:68)
... 10 more
The text was updated successfully, but these errors were encountered: