Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on connection failures #1857

Closed
vin01 opened this issue Dec 15, 2020 · 3 comments
Closed

Memory leak on connection failures #1857

vin01 opened this issue Dec 15, 2020 · 3 comments
Labels
stale Issues and pull requests without any recent activity

Comments

@vin01
Copy link

vin01 commented Dec 15, 2020

Versions
Sarama Kafka Go
1.27.1 2.6.0 1.14
Logs

Following logs also have &b.opened values along with the already present log message to highlight the issue.

logs: CLICK ME

Dec 15 14:18:58 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:18:58 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634251480)
Dec 15 14:18:28 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:18:28 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634252376)
Dec 15 14:18:28 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:18:28 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634251480)
Dec 15 14:17:58 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:17:58 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634252376)
Dec 15 14:17:58 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:17:58 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634251480)
Dec 15 14:17:28 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:17:28 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634252376)
Dec 15 14:17:28 [machineid] kafka_exporter[2611756]: [sarama] 2020/12/15 14:17:28 Failed to connect to broker hostname:9092: dial tcp [ipv6_addr]:9092: i/o timeout (mem ref: 824634251480)

Problem Description

The way atomic has been used to track connections, it leaks memory on connection timeouts and potentially other failures as well. I have noticed this while debugging increasing memory usage for kafka exporter which uses sarama

this seems to be the cause as it simply keeps using up memory space for new connections and is not cleared which is troubling in the case of failed connections.

Thanks!

@ghost
Copy link

ghost commented Mar 16, 2021

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@ghost ghost added the stale Issues and pull requests without any recent activity label Mar 16, 2021
@vin01
Copy link
Author

vin01 commented Mar 17, 2021

Not stale, as danielqsj/kafka_exporter#54 still is being updated. I personally have not been able to test this again since my last comment.

@github-actions github-actions bot removed the stale Issues and pull requests without any recent activity label Aug 25, 2023
Copy link

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@github-actions github-actions bot added the stale Issues and pull requests without any recent activity label Nov 23, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and pull requests without any recent activity
Projects
None yet
Development

No branches or pull requests

1 participant