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

[LI-CHERRY-PICK] KAFKA-13558: NioEchoServer fails to close resources (#11618) #487

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

lmr3796
Copy link

@lmr3796 lmr3796 commented Oct 30, 2023

LI_DESCRIPTION=Potentially reduce flaky tests

-- Original message --

Due to resource leaks in the NioEchoServer, at times it won't start
properly to accept clients and will throw an exception in the
ServerSocketChannel.accept() call. Previous to this change, the error
was not being logged. The logged error was that there were too many open
files. Using the UnixOperatingSystemMXBean, I was able to detect that
use of the NioEchoServer creates several FDs but does not close them.
This then caused the client to never be able to connect to the server,
so the waitForCondition failed intermittently.

This change closes the internal Selector and the AcceptorThread's
selector so that the file descriptors are reclaimed.

Reviewers: Ismael Juma [email protected]

Kirk True and others added 2 commits October 30, 2023 09:31
…pache#11618)

LI_DESCRIPTION=Potentially reduce flaky tests

-- Original message --

Due to resource leaks in the NioEchoServer, at times it won't start
properly to accept clients and will throw an exception in the
ServerSocketChannel.accept() call. Previous to this change, the error
was not being logged. The logged error was that there were too many open
files. Using the UnixOperatingSystemMXBean, I was able to detect that
use of the NioEchoServer creates several FDs but does not close them.
This then caused the client to never be able to connect to the server,
so the waitForCondition failed intermittently.

This change closes the internal Selector and the AcceptorThread's
selector so that the file descriptors are reclaimed.

Reviewers: Ismael Juma <[email protected]>
Copy link

@groelofs groelofs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little fix. I wonder if this has ever hit us on shared CI machines, especially given the sheer number of tests in the Kafka tree...

@lmr3796 lmr3796 merged commit 13f78ab into 3.0-li Oct 31, 2023
25 checks passed
@lmr3796 lmr3796 deleted the tlin-patch3 branch October 31, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants