Skip to content

Commit 254dcac

Browse files
committed
Fixup BrokerConnection check_version strict error checking: 0.9 will fail with CorrelationIdError
1 parent d7fa073 commit 254dcac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kafka/conn.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,13 @@ def connect():
598598
# get a basic Request Timeout. This is not ideal, but we'll deal
599599
if isinstance(f.exception, Errors.RequestTimedOutError):
600600
pass
601+
602+
# 0.9 brokers do not close the socket on unrecognized api
603+
# requests (bug...). In this case we expect to see a correlation
604+
# id mismatch
605+
elif (isinstance(f.exception, Errors.CorrelationIdError) and
606+
version == '0.10'):
607+
pass
601608
elif six.PY2:
602609
assert isinstance(f.exception.args[0], socket.error)
603610
assert f.exception.args[0].errno in (32, 54, 104)

0 commit comments

Comments
 (0)