Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Update src/main/java/redis/clients/util/RedisOutputStream.java #358

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

flushBuffer() this add try finally,because when out.write(buf, 0, count); throw error,the count=0 is not exec; ?it's cause java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Long? ?at redis.clients.jedis.Connection.getIntegerReply(Connection.java:161)? ?at redis.clients.jedis.Jedis.del(Jedis.java:108)?  在这个方法里,应该加入try finally,因为当out.write(buf, 0, count); 这句抛出异常时,会造成 count=0;这一行 不能正常执行,就行造成部分剩余的错误命令在下次的请求中,会再次发送,将会造成java.lang.ClassCastException异常

Update src/main/java/redis/clients/util/RedisOutputStream.java
flushBuffer() this add try finally,because when out.write(buf, 0, count); throw error,the count=0 is not exec; ?it's cause java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Long? ?at redis.clients.jedis.Connection.getIntegerReply(Connection.java:161)? ?at redis.clients.jedis.Jedis.del(Jedis.java:108)?  在这个方法里,应该加入try finally,因为当out.write(buf, 0, count); 这句抛出异常时,会造成 count=0;这一行 不能正常执行,就行造成部分剩余的错误命令在下次的请求中,会再次发送,将会造成java.lang.ClassCastException异常

RedisOutputStream is just a non-thread safe version of BufferedOutputStream in the JDK. I believe it's the user's responsibility to handle this kindle of exceptions to make it work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment