-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ServerConnector leaks closed sockets which can lead to file descriptor exhaustion #5794
Comments
joewitt
added a commit
to joewitt/jetty.project
that referenced
this issue
Dec 11, 2020
…ailed bind to ensure proper resources are cleaned Signed-off-by: Joe Witt <[email protected]>
joewitt
added a commit
to joewitt/jetty.project
that referenced
this issue
Dec 11, 2020
…ailed bind to ensure proper resources are cleaned Signed-off-by: Joe Witt <[email protected]>
sbordet
added a commit
that referenced
this issue
Dec 14, 2020
Issue #5794 ensuring serverChannel is closed in the event of a failed bind to ensure proper resources are cleaned
gregw
added a commit
that referenced
this issue
Dec 14, 2020
This was referenced Mar 10, 2021
This was referenced Mar 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jetty version
9.4.35.v20201120 and older
Java version
OpenJDK Runtime Environment (build 1.8.0_272-b10) and others
OS type/version
OSX and Linux
Description
The ServerConnector class in openAcceptChannel creates a local variable which is an opened server socket channel. Then when attempting to bind to the specified port, if there is an exception, it will throw a new exception and not clean up the created channel/resource. The fix is to ensure that in the event of a bind exception the serverChannel is properly closed before throwing the exception back to the caller. Without this change the socket will be in a CLOSED state and a file descriptor held for it for the remainder of the life of the process.
The text was updated successfully, but these errors were encountered: