summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2017-03-03 17:51:48 -0800
committerGitHub <noreply@github.com>2017-03-03 17:51:48 -0800
commit61eb396bba268f892a657b2e4d7bd813aabc88ec (patch)
treec5f55bad0ab1b8085119d8690b197b07a360318b
parentc741c5342e8fbf682d6b2811ecde4f1b0491a655 (diff)
downloadkafka-python-61eb396bba268f892a657b2e4d7bd813aabc88ec.tar.gz
When closing a broker connection without error, fail in-flight-requests with Cancelled (#1010)
-rw-r--r--kafka/conn.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index 8f4fefe..ab86804 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -511,7 +511,7 @@ class BrokerConnection(object):
self._rbuffer.seek(0)
self._rbuffer.truncate()
if error is None:
- error = Errors.ConnectionError(str(self))
+ error = Errors.Cancelled(str(self))
while self.in_flight_requests:
ifr = self.in_flight_requests.popleft()
ifr.future.failure(error)