Skip to content

Commit 3dc536a

Browse files
authored
Re-enable logging during broker version check (dpkp#1430)
1 parent eb941ee commit 3dc536a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

kafka/conn.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ def check_version(self, timeout=2, strict=False):
906906
907907
Returns: version tuple, i.e. (0, 10), (0, 9), (0, 8, 2), ...
908908
"""
909+
log.info('Probing node %s broker version', self.node_id)
909910
# Monkeypatch some connection configurations to avoid timeouts
910911
override_config = {
911912
'request_timeout_ms': timeout * 1000,
@@ -924,17 +925,6 @@ def check_version(self, timeout=2, strict=False):
924925
from kafka.protocol.admin import ApiVersionRequest, ListGroupsRequest
925926
from kafka.protocol.commit import OffsetFetchRequest, GroupCoordinatorRequest
926927

927-
# Socket errors are logged as exceptions and can alarm users. Mute them
928-
from logging import Filter
929-
930-
class ConnFilter(Filter):
931-
def filter(self, record):
932-
if record.funcName == 'check_version':
933-
return True
934-
return False
935-
log_filter = ConnFilter()
936-
log.addFilter(log_filter)
937-
938928
test_cases = [
939929
# All cases starting from 0.10 will be based on ApiVersionResponse
940930
((0, 10), ApiVersionRequest[0]()),
@@ -1004,7 +994,6 @@ def filter(self, record):
1004994
else:
1005995
raise Errors.UnrecognizedBrokerVersion()
1006996

1007-
log.removeFilter(log_filter)
1008997
for key in stashed:
1009998
self.config[key] = stashed[key]
1010999
return version

0 commit comments

Comments
 (0)