From 254dcacb28f66c8426fb8ff161b88e2feb4c486a Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Tue, 17 May 2016 07:23:37 -0700 Subject: Fixup BrokerConnection check_version strict error checking: 0.9 will fail with CorrelationIdError --- kafka/conn.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kafka') diff --git a/kafka/conn.py b/kafka/conn.py index 8f0539b..db56dda 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -598,6 +598,13 @@ class BrokerConnection(object): # get a basic Request Timeout. This is not ideal, but we'll deal if isinstance(f.exception, Errors.RequestTimedOutError): pass + + # 0.9 brokers do not close the socket on unrecognized api + # requests (bug...). In this case we expect to see a correlation + # id mismatch + elif (isinstance(f.exception, Errors.CorrelationIdError) and + version == '0.10'): + pass elif six.PY2: assert isinstance(f.exception.args[0], socket.error) assert f.exception.args[0].errno in (32, 54, 104) -- cgit v1.2.1