aio-libs / aio-libs/aiokafka

KafkaConnectionError for Azure Event Hub during connect phase

Abierto
#899 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
1.4k
Forks
269
Merge medio
1 d 1 h
PR fusionados (30 d)
6

Descripción

We are using a Azure Event Hub as our Kafka compatible broker.
We noticed, that occasionally the connection process does not complete successfully, but throws the following error:

```
DEBUG:aiokafka:Attempting to bootstrap via node at xxx..servicebus.windows.net:9093
ERROR:aiokafka:Unable connect to "xxx.servicebus.windows.net:9093":
[...]
KafkaConnectionError: Unable to bootstrap from [('xxx.servicebus.windows.net', 9093, )]
```

The error happens [here](https://github.com/aio-libs/aiokafka/blob/5ce5649563cd691c77ff490998de16e73f2d8718/aiokafka/client.py#L226).

This error is reproducible when starting and stopping a connection via aiokafka in a loop. At the attempt ~14 the connection fails with the above error.
We analyzed the traffic during these attempts and saw, that the Azure Event Hub sends a TCP reset packet for the unsuccessful connection attempt. Therefore, this is not necessarily an issue with `aiokafka`, but could be related to some limits applied by Azure Event Hub.

Since we expect many people are using this library together with Azure Event Hub, we are wondering if other people experience the same issue? We do not understand yet if the their is a rate limiting in place with Azure or any other reason the hub does not allow this connection attempt anymore after the previous ones have been successful.

Currently, the only workaround we have is implementing a retry mechanism for this specific error, since another connection attempt after this error usually works.

**Environment**
- aiokafka version: 0.8.0
- kafka-python version: 2.0.2
- Azure Event Hub broker

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.