diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-11-17 20:24:14 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-11-17 20:24:14 -0800 |
commit | dc45935ec8afe3bd279048351bd21c9dd9d82fdf (patch) | |
tree | 6a2d27aab699b57960ba354793688390f620518f /kafka/conn.py | |
parent | 0bf7ea0f67ae6d80a2939b36b63616825674cbed (diff) | |
download | kafka-python-timeout_noresponse.tar.gz |
Also/continue to check for timeouts in BrokerConnection.recv()timeout_noresponse
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index 0d90cc0..14f4d6d 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -575,7 +575,15 @@ class BrokerConnection(object): log.warning('%s: No in-flight-requests to recv', self) return None - return self._recv() + response = self._recv() + if not response and self.requests_timed_out(): + log.warning('%s timed out after %s ms. Closing connection.', + self, self.config['request_timeout_ms']) + self.close(error=Errors.RequestTimedOutError( + 'Request timed out after %s ms' % + self.config['request_timeout_ms'])) + return None + return response def _recv(self): # Not receiving is the state of reading the payload header |