Browse Source

BI-88269 fix: 集群环境下FineBoundedBlockingQueue的相关问题,

订阅多线程下线程安全问题, 这儿针对这个bug改下, 后续可考虑升级jedis版本
feature/10.0
Dylan.Liu 3 years ago
parent
commit
cbd995ac76
  1. 5
      fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/Connection.java
  2. 2
      fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/JedisPubSub.java

5
fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/Connection.java

@ -276,6 +276,11 @@ public class Connection implements Closeable {
return (List<Object>) readProtocolWithCheckingBroken();
}
@SuppressWarnings("unchecked")
public List<Object> getUnflushedObjectMultiBulkReply() {
return (List<Object>) readProtocolWithCheckingBroken();
}
public List<Object> getObjectMultiBulkReply() {
return getRawObjectMultiBulkReply();
}

2
fine-jedis/src/main/java/com/fr/third/redis/clients/jedis/JedisPubSub.java

@ -128,7 +128,7 @@ public abstract class JedisPubSub {
private void process(Client client) {
do {
List<Object> reply = client.getRawObjectMultiBulkReply();
List<Object> reply = client.getUnflushedObjectMultiBulkReply();
final Object firstObj = reply.get(0);
if (!(firstObj instanceof byte[])) {
throw new JedisException("Unknown message type: " + firstObj);

Loading…
Cancel
Save