diff options
author | Dana Powers <dana.powers@gmail.com> | 2017-03-03 12:20:37 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2017-03-03 14:20:05 -0800 |
commit | ba466a388f84b3d8878fc202a6d8644f082fc2dd (patch) | |
tree | ff81352661c08369b63cd1ec5949ad76f85d70fc | |
parent | 315850c87759d8379899fbfdc6a882100d4a7020 (diff) | |
download | kafka-python-cancel_in_flight.tar.gz |
When closing a broker connection without error, fail in-flight-requests with Cancelledcancel_in_flight
-rw-r--r-- | kafka/conn.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index ae3c55d..76a4177 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -510,7 +510,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) |