aio-libs / aio-libs/aiokafka

Closed connections are not refreshed in client.py _send

Open
#1,118 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
269
Avg merge
1d 1h
Merged PRs (30d)
6

Description

**Describe the bug**
[_get_conn](https://github.com/aio-libs/aiokafka/blob/master/aiokafka/client.py#L424) refreshes closed connections but [_send](https://github.com/aio-libs/aiokafka/blob/master/aiokafka/client.py#L515) doesn't use `_get_conn` so it will try to send data over a connections that got closed e.g. due to being idle for too long.

This results in
```
Error sending OffsetCommitRequest_v2 to node 11 [KafkaConnectionError: Connection at ... closed] -- marking coordinator dead
```
for our use case.

**Expected behaviour**
`_send` should refresh closed connections

**Environment**
- aiokafka version 0.12.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.