From f86068a51a50dcd472d2c5ddf62fc61545e7f173 Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Thu, 10 Dec 2015 18:40:11 -0800 Subject: [PATCH] Check for no in-flight-requests in BrokerConnection.recv --- kafka/conn.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kafka/conn.py b/kafka/conn.py index bd399a9..d45b824 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -89,6 +89,9 @@ class BrokerConnection(local): readable, _, _ = select([self._read_fd], [], [], timeout) if not readable: return None + if not self.in_flight_requests: + log.warning('No in-flight-requests to recv') + return None correlation_id, response_type = self.in_flight_requests.popleft() # Current implementation does not use size # instead we read directly from the socket fd buffer