Use ConnectionError rather than new DisconnectError
This commit is contained in:
@@ -106,11 +106,6 @@ class IllegalArgumentError(KafkaError):
|
||||
pass
|
||||
|
||||
|
||||
class DisconnectError(KafkaError):
|
||||
retriable = True
|
||||
invalid_metadata = True
|
||||
|
||||
|
||||
class NoBrokersAvailable(KafkaError):
|
||||
retriable = True
|
||||
invalid_metadata = True
|
||||
@@ -412,7 +407,8 @@ class FailedPayloadsError(KafkaError):
|
||||
|
||||
|
||||
class ConnectionError(KafkaError):
|
||||
pass
|
||||
retriable = True
|
||||
invalid_metadata = True
|
||||
|
||||
|
||||
class BufferUnderflowError(KafkaError):
|
||||
|
||||
@@ -128,7 +128,7 @@ class BrokerConnection(object):
|
||||
self._rbuffer.seek(0)
|
||||
self._rbuffer.truncate()
|
||||
if error is None:
|
||||
error = Errors.DisconnectError()
|
||||
error = Errors.ConnectionError()
|
||||
while self.in_flight_requests:
|
||||
ifr = self.in_flight_requests.popleft()
|
||||
ifr.future.failure(error)
|
||||
@@ -140,7 +140,7 @@ class BrokerConnection(object):
|
||||
"""
|
||||
future = Future()
|
||||
if not self.connected():
|
||||
return future.failure(Errors.DisconnectError())
|
||||
return future.failure(Errors.ConnectionError())
|
||||
if not self.can_send_more():
|
||||
return future.failure(Errors.TooManyInFlightRequests())
|
||||
self._correlation_id += 1
|
||||
|
||||
Reference in New Issue
Block a user