-
Notifications
You must be signed in to change notification settings - Fork 18
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
KafkaSinkCluster: handle broker closing connection due to idle timeout #1752
Merged
rukai
merged 4 commits into
shotover:main
from
rukai:catch_closed_connections_during_send
Sep 18, 2024
Merged
KafkaSinkCluster: handle broker closing connection due to idle timeout #1752
rukai
merged 4 commits into
shotover:main
from
rukai:catch_closed_connections_during_send
Sep 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rukai
force-pushed
the
catch_closed_connections_during_send
branch
from
September 17, 2024 01:33
c3f2530
to
06ae653
Compare
CodSpeed Performance ReportMerging #1752 will improve performances by 10.65%Comparing Summary
Benchmarks breakdown
|
rukai
force-pushed
the
catch_closed_connections_during_send
branch
3 times, most recently
from
September 17, 2024 03:01
5fa3428
to
f1454b4
Compare
rukai
force-pushed
the
catch_closed_connections_during_send
branch
from
September 17, 2024 03:04
f1454b4
to
20faa0f
Compare
rukai
commented
Sep 17, 2024
rukai
force-pushed
the
catch_closed_connections_during_send
branch
from
September 17, 2024 03:59
69d3073
to
ffca2ef
Compare
rukai
changed the title
catch closed connections during send
KafkaSinkCluster handle kafka broker closing connections due to idle timeout
Sep 17, 2024
rukai
changed the title
KafkaSinkCluster handle kafka broker closing connections due to idle timeout
KafkaSinkCluster: handle broker closing connection due to idle timeout
Sep 17, 2024
rukai
force-pushed
the
catch_closed_connections_during_send
branch
from
September 17, 2024 04:27
ffca2ef
to
356bd0e
Compare
rukai
force-pushed
the
catch_closed_connections_during_send
branch
from
September 17, 2024 05:16
356bd0e
to
5722c26
Compare
rukai
commented
Sep 17, 2024
ronycsdu
approved these changes
Sep 18, 2024
|
justinweng-instaclustr
approved these changes
Sep 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kafka brokers have a config field
connections.max.idle.ms
, when a connection has been idle for longer than this timeout.Normally a client can expect idle connections to timeout after some time of being unused.
However when KafkaSinkCluster is sitting in between the client and the broker there can be some unexpected behaviour.
For example:
connections.max.idle.ms=5s
.With more reasonable timeout values this issue is harder to hit, but we are still still hitting this in our preprod environment with the default idle timeout of 10 minutes.
Integration test
This PR introduces an integration test that runs kafka with a very low connections.max.idle.ms (30s), this reproduces the issue described above.
The new integration test fails when running the shotover main branch.
Fix implementation
This PR then fixes the failing test by adding a check into our connection getting logic to recreate the connection if it has hit an error.
This does not attempt to fix all possible failures due to closed connection, as that would be impossible due to race conditions.
Instead we make a best effort handling which will catch the regular failures we are seeing.