aio-libs / aio-libs/aiokafka

[QUESTION] Unable connect to node with id: X: [Errno 111]: Connection refused

オープン
#992 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る
question
主要言語
Python
スター
1.4k
フォーク
269
平均マージ
1日 1時間
マージ済み PR(30日)
6

説明

Hi, I have group of consumers that on startup connect to kafka and infinite consume to messages. And I've encountered a problem that when the address of the kafka changes, the consumers don't get an error, just an infinite error logging. Since the Kafka address is taken from environment variables and I have an automatic reboot if an error occurs, it would be great if the consumer would raise an error

```
consumer = AIOKafkaConsumer(
*kafka_consumer_settings.topics
bootstrap_servers=kafka_consumer_settings.bootstrap_servers,
group_id=kafka_consumer_settings.group_id
)

try:
async for msg in consumer:
# Some message processing
finally:
await consumer.stop() # <--- it is not executed in case of 'Unable connect to node with id: X: [Errno 111]: Connection refused'
```

I found it in source code:
https://github.com/aio-libs/aiokafka/blob/256ce17c2d235f417b5302a6046c27879ce610f7/aiokafka/client.py#L475-L481

Do I understand correctly that the error is not triggered only when the consumer is in a group?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。