-
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 2.4.2 java.lang.ArrayIndexOutOfBoundsException: 8192 #636
Comments
out.write(buf, 0, count); |
Hi @xiaonanforever, thanks for reporting the error. I could reproduce the scenario and actually made an automated test for it. I'll try to get it fixed by today. Keep you posted. Best, Marcos. |
@xiaonanforever I've pushed a fix in the protocol_bound_fix branch. Is there a chance you can give it a try? |
@marcosnils 👍 |
@marcosnils |
@marcosnils
But yours is better. |
We also hit this while testing under high load. I see it did not make 2.5.0 - any chance that it can make 2.5.1? What is needed to move this forward? |
PR #651 fixes this. |
Checks for buffer out of bounds before writing to the stream. Fixes #636
Ok... version 2.5.1 released. Please upgrade! And sorry about that! |
No problem and thanks for the fast turn around. I have pulled it down. We Thanks again,
|
In my log,I found 👍
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:83) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:63) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Connection.sendCommand(Connection.java:84) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.BinaryClient.hgetAll(BinaryClient.java:273) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Client.hgetAll(Client.java:197) ~[jedis-2.4.2.jar:na]
......
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.7.0_45]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) ~[na:1.7.0_45]
at java.net.SocketOutputStream.write(SocketOutputStream.java:159) ~[na:1.7.0_45]
at redis.clients.util.RedisOutputStream.flushBuffer(RedisOutputStream.java:31) ~[jedis-2.4.2.jar:na]
at redis.clients.util.RedisOutputStream.write(RedisOutputStream.java:39) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:69) ~[jedis-2.4.2.jar:na]
... 48 common frames omitted
Following:
java.lang.ArrayIndexOutOfBoundsException: 8192
at redis.clients.util.RedisOutputStream.write(RedisOutputStream.java:37) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:69) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:63) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.Connection.sendCommand(Connection.java:84) ~[jedis-2.4.2.jar:na]
at redis.clients.jedis.BinaryClient.hgetAll(BinaryClient.java:273) ~[jedis-2.4.2.jar:na]
8192? Yes it's here:
public final class RedisOutputStream extends FilterOutputStream {
protected final byte buf[];
If connection disconnet,and that time if count=8192,
private void flushBuffer() throws IOException {
if (count > 0) {
out.write(buf, 0, count);//my throw java.net.SocketException: Broken pipe,then the count allways is 8192,and ArrayIndexOutOfBoundsException 8193、8194 and so....
count = 0;
}
}
The text was updated successfully, but these errors were encountered: