Skip to content

Client SeekBroker Connection Leak #3143

@BAN1ce

Description

@BAN1ce
Description

Running producer to produce messages. after that reset the net. use lsof will see some closed TCP connection. and they will never disappear until restart the process.

Sarama Kafka Go
release/1.45.1
Problem Description

The function LeastLoadedBroker, if the client.brokers is empty, then will use seedBroker

_ = client.seedBrokers[0].Open(client.conf)
to connect the broker by create a new TCP. after that, the created TCP connection will never close. if net reset, the closed TCP will never release. So I found use RefreshBrokers func can fix the issue. but not every time. some closed TCP still can not release. My question is :

  1. Is there connection leaked?
  2. if so, anyway to fix it except RefreshBrokers func.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-investigationIssues that require followup from maintainersstale/exemptIssues and pull requests that should never be closed as stale

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions