diff --git a/src/main/java/redis/clients/jedis/Connection.java b/src/main/java/redis/clients/jedis/Connection.java index a214750781..be0fe6d5c4 100644 --- a/src/main/java/redis/clients/jedis/Connection.java +++ b/src/main/java/redis/clients/jedis/Connection.java @@ -383,11 +383,17 @@ private void initializeFromClientConfig(JedisClientConfig config) { sendCommand(arg); } - // getMany and ignore result - getMany(fireAndForgetMsg.size()); + flush(); + for (int i = 0; i < fireAndForgetMsg.size(); i++) { + readProtocolWithCheckingBroken(); + } } catch (JedisDataException e) { - // just ignore dataException, such as unknown command + if (e.getMessage().contains("unknown")) { + // just ignore dataException, such as unknown command + } else { + throw e; + } } } catch (JedisException je) { try {