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

Write i/o timeout when Closing TLS connection #1722

Closed
KenjiTakahashi opened this issue Jun 11, 2020 · 2 comments
Closed

Write i/o timeout when Closing TLS connection #1722

KenjiTakahashi opened this issue Jun 11, 2020 · 2 comments
Labels
stale Issues and pull requests without any recent activity

Comments

@KenjiTakahashi
Copy link

Versions
Sarama Kafka Go
v1.26.4/0189d59 2.5.0 1.14.4
Configuration

Really the important part is TLS Enabled, i.e.

config.Net.TLS.Enable = true
config.Net.TLS.Config = tlsConfig
Logs

Again, the relevant part is this log.

[SARAMA] 2020/06/11 10:24:59 Error while closing connection to broker localhost:9092: write tcp [::1]:37390->[::1]:9092: i/o timeout
Problem Description

After enabling TLS, the above error happens on client Close() call. Without TLS, everything works fine.
I went down to it and figured that the culprit is https://github.com/Shopify/sarama/blob/0189d59e5253ee7aa2a9eb50bffd18a69460630d/broker.go#L309
but that's probably because it's the first write executed on the connection?

Going further, I found out that removing deadline from https://github.com/Shopify/sarama/blob/0189d59e5253ee7aa2a9eb50bffd18a69460630d/broker.go#L708
(or setting it to time.Time{}) removes the problem.
Then I found this report golang/go#13828 stating that SetWriteDeadline does not seem to work properly on TLS Clients. Which appears to be (still) true.

Honestly, not sure what can realistically be done about it in sarama, removing deadlines does not sound like viable solution. Still thought I will share my findings.

@d1egoaz
Copy link
Contributor

d1egoaz commented Jun 19, 2020

maybe @dnwe has more information about this.
He added something similar here #1529

@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
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 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

2 participants