aio-libs / aio-libs/aiokafka

Unclosed consumer and producer warnings when using AsyncContextManager interface

Abierto
#1,130 0 comentarios 1 reacción 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

**Describe the bug**
Consumers and Producers when `__aenter__()` errors (such as network-related exceptions) leaves the object in a state requiring an explicit `close()` call.

Context manager interfaces via the "with" keyword do not invoke `__aclose__()` if entering failed.

**Expected behaviour**
`__aenter__()` and `start()` if an exception raises put the object back into an "unentered" state, and potentially allow trying again later.

**Environment (please complete the following information):**
- aiokafka version (`python -c "import aiokafka; print(aiokafka.__version__)"`): 0.12.0
- Kafka Broker version (`kafka-topics.sh --version`): 2.8.1

**Reproducible example**
See [Fork Commit](https://github.com/calgray/aiokafka/pull/1/commits/87dd905ac42189837af0c6a7d1f30eafda6e17a4)

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.