Browse Source

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

Merge in CORE/base-third from ~DYLAN.LIU/base-third:feature/10.0 to feature/10.0

* commit 'cbd995ac760b97eb0aadfe716324cd223cd28cbe':
  BI-88269 fix: 集群环境下FineBoundedBlockingQueue的相关问题, 订阅多线程下线程安全问题, 这儿针对这个bug改下, 后续可考虑升级jedis版本
feature/10.0
Dylan.Liu 3 years ago
parent
commit
bcee40656e
  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(); return (List<Object>) readProtocolWithCheckingBroken();
} }
@SuppressWarnings("unchecked")
public List<Object> getUnflushedObjectMultiBulkReply() {
return (List<Object>) readProtocolWithCheckingBroken();
}
public List<Object> getObjectMultiBulkReply() { public List<Object> getObjectMultiBulkReply() {
return getRawObjectMultiBulkReply(); 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) { private void process(Client client) {
do { do {
List<Object> reply = client.getRawObjectMultiBulkReply(); List<Object> reply = client.getUnflushedObjectMultiBulkReply();
final Object firstObj = reply.get(0); final Object firstObj = reply.get(0);
if (!(firstObj instanceof byte[])) { if (!(firstObj instanceof byte[])) {
throw new JedisException("Unknown message type: " + firstObj); throw new JedisException("Unknown message type: " + firstObj);

Loading…
Cancel
Save