Browse Source

Merge pull request #2736 in CORE/base-third from feature/10.0 to research/10.0

* commit 'bcee40656e5a05205e91554e39bcf476a1fdd817':
  BI-88269 fix: 集群环境下FineBoundedBlockingQueue的相关问题, 订阅多线程下线程安全问题, 这儿针对这个bug改下, 后续可考虑升级jedis版本
research/10.0
superman 3 years ago
parent
commit
9a8ceb2a0a
  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