Comments (1)
It seems that the only place where the connection is deleted until the consumer is running is the exit from the method
async def start(self):
self._client.bootstrap()
# Here
The next assumption is that when the connection's closing method is called, the connection is not closed immediately. Related comment
def close(self, reason=None, exc=None):
self.log.debug("Closing connection at %s:%s", self._host, self._port)
if self._reader is not None:
self._writer.close()
self._writer = self._reader = None
if not self._read_task.done():
self._read_task.cancel()
self._read_task = None
for _, _, fut in self._requests:
if not fut.done():
error = Errors.KafkaConnectionError(
f"Connection at {self._host}:{self._port} closed"
)
if exc is not None:
error.__cause__ = exc
error.__context__ = exc
fut.set_exception(error)
self._requests = collections.deque()
if self._on_close_cb is not None:
self._on_close_cb(self, reason)
self._on_close_cb = None
if self._idle_handle is not None:
self._idle_handle.cancel()
# transport.close() will close socket, but not right ahead. Return
# a future in case we need to wait on it.
return self._closed_fut
We have a workaround with a future self._closed_fut
, waiting for which we guarantee that the socket was closed. It seems we are missing waiting for this future when calling bootstrap
method
from aiokafka.
Related Issues (20)
- IncompatibleBrokerVersion: Kafka broker does not support the 'CreateTopicsRequest_v0' Kafka protocol. HOT 4
- [QUESTION] Restarting `AIOKafkaConsumer` after `AIOKafkaConsumer.stop()` HOT 3
- [QUESTION] How to close connection if Kafka server isn't responding?
- [QUESTION] Is there support to refresh OAuth tokens automatically based on token expiration duration?
- Add client.rack configuration option to support consumer fetching from closest replica (KIP-392)
- [QUESTION] idempotent producer and OutOfOrderSequenceNumber problem
- Can't Recover From NotLeaderForPartitionError
- Connection errors are spamming HOT 1
- Update `aiokafka` library to support higher client versions > 3 HOT 7
- A large and controversial proposal: replace protocol implementation with kio HOT 3
- Severe performance degradation after migrating to cramjam LZ4
- Losing Messages Between Producer and Consumer HOT 4
- lz4 compression codec not found even after installing lz4 module HOT 5
- Long running consumer stop receiving messages and it's state is not closed HOT 3
- Closing of connection from server don't caught for uvloop
- Producer.send_and_wait() hangs up forever if `sender_task` is cancelled
- [QUESTION] Is there a way to monitor the heartbeat state?
- [QUESTION] Is there a way to monitor the heartbeat state? HOT 1
- Admin client: list offsets per topic/partition
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiokafka.