Repository navigation
HDDS-17436. XceiverServerDomainSocket retries a failed accept() at once and spins while the datanode is out of file descriptors - #11798
Draft
Gargi-jais11 wants to merge 1 commit into
Draft
Gargi-jais11 wants to merge 1 commit into
Gargi-jais11 wants to merge 1 commit into
Conversation
This file contains hidden or 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
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.
What changes were proposed in this pull request?
When
accept()itself fails inXceiverServerDomainSocket.run, the loop logs a WARN and calls accept() again right away. For example, accept(2) fails with"Too many open files"when the datanode is out of file descriptors. On Linux, the queued connection keeps failing, so the accept thread spins on a CPU core and logs thousands of WARN stack traces per second until descriptors are free again.Changes done:
This change adds a 1-second pause before retrying when accept() itself fails, which is when no peer has been created yet. Rejections of accepted connections, such as at the xceiver limit, and idle accept timeouts behave as before. Shutdown isn't delayed, because stop() interrupts the pause.
KEPT in draft to save CI resources, will mark it ready to review once approved
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17436
How was this patch tested?
added
testAcceptFailureIsRetriedAfterPauseto TestXceiverServerDomainSocket. Without the fix it fails with about 14,600 accept() calls in 500 ms; with the fix it passes.Without fix: (added few lines from test runs)
After fix: