setting proper topic value in case if it's empty (#867)
This commit is contained in:
committed by
Dana Powers
parent
6bd1e1db57
commit
af7f2ced1b
@@ -708,18 +708,11 @@ class KafkaClient(object):
|
|||||||
self._last_no_node_available_ms = time.time() * 1000
|
self._last_no_node_available_ms = time.time() * 1000
|
||||||
return timeout
|
return timeout
|
||||||
|
|
||||||
topics = list(self._topics)
|
|
||||||
if self.cluster.need_all_topic_metadata:
|
|
||||||
if self.config['api_version'] < (0, 10):
|
|
||||||
topics = []
|
|
||||||
else:
|
|
||||||
topics = None
|
|
||||||
|
|
||||||
if self._can_send_request(node_id):
|
if self._can_send_request(node_id):
|
||||||
if self.config['api_version'] < (0, 10):
|
topics = list(self._topics)
|
||||||
api_version = 0
|
if self.cluster.need_all_topic_metadata or not topics:
|
||||||
else:
|
topics = [] if self.config['api_version'] < (0, 10) else None
|
||||||
api_version = 1
|
api_version = 0 if self.config['api_version'] < (0, 10) else 1
|
||||||
request = MetadataRequest[api_version](topics)
|
request = MetadataRequest[api_version](topics)
|
||||||
log.debug("Sending metadata request %s to node %s", request, node_id)
|
log.debug("Sending metadata request %s to node %s", request, node_id)
|
||||||
future = self.send(node_id, request)
|
future = self.send(node_id, request)
|
||||||
|
|||||||
Reference in New Issue
Block a user