diff options
-rw-r--r-- | kafka/client.py | 5 | ||||
-rw-r--r-- | kafka/conn.py | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/kafka/client.py b/kafka/client.py index 821904c..33c6d77 100644 --- a/kafka/client.py +++ b/kafka/client.py @@ -3,11 +3,10 @@ from collections import defaultdict from functools import partial from itertools import count import logging -import socket import time from kafka.common import ( - ErrorMapping, TopicAndPartition, BufferUnderflowError, ConnectionError, + ErrorMapping, TopicAndPartition, ConnectionError, FailedPayloadsException ) from kafka.conn import KafkaConnection @@ -175,7 +174,7 @@ class KafkaClient(object): continue try: response = conn.recv(requestId) - except (ConnectionError, BufferUnderflowError), e: + except ConnectionError, e: log.warning("Could not receive response to request [%s] " "from server %s: %s", request, conn, e) failed = True diff --git a/kafka/conn.py b/kafka/conn.py index b2916ce..9a6633a 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -4,7 +4,6 @@ import socket import struct from threading import local -from kafka.common import BufferUnderflowError from kafka.common import ConnectionError log = logging.getLogger("kafka") @@ -53,8 +52,8 @@ class KafkaConnection(local): log.error('Unable to receive data from Kafka: %s', e) self._raise_connection_error() if data == '': - self._dirty = True - raise BufferUnderflowError("Not enough data to read this response") + log.error("Not enough data to read this response") + self._raise_connection_error() bytes_left -= len(data) log.debug("Read %d/%d bytes from Kafka", num_bytes - bytes_left, num_bytes) resp += data |