-
Notifications
You must be signed in to change notification settings - Fork 14.9k
KAFKA-13457: SocketChannel in Acceptor#accept is not closed upon IOException #11504
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
Conversation
showuon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@functioner , thanks for finding this issue and fixing it. LGTM! Left a minor comment. Thanks.
dajac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@functioner Thanks for the patch.
It seems that the fix does not fully match the description in the JIRA. In the JIRA, you wrote the following: However, line 717 or the socketChannel operations within the try block may potentially throw an IOException as well, which is not handled.. And you refers to this line:
val socketChannel = serverSocketChannel.accept() // line 717
The try/catch block where the IOException has been added does not wrap that line so it does not catch it. I suppose that the description of the JIRA is incorrect in this case because we can't close the socketChannel if we don't have it.
However, it seems to be that such issue could be caused by socketChannel.configureBlocking(false) which could also thrown an IOException. Am I getting this right?
Do you think that we could add a unit test for this bug?
|
Are there any other issues or concern with the current patch and test? If any, I will resolve ASAP. Will this PR be merged soon by any chance? |
|
@functioner It seems that the code does not compile. I seems to be due to 30a9085 which added an parameter to the |
dajac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. Left a few comments.
dajac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the patch.
|
Thanks everybody here for the suggestions and merging the patch! |
…ception (apache#11504) This patch ensures that SocketChannel in Acceptor#accept is closed if an IOException is thrown while the socket is configured. Reviewers: Luke Chen <[email protected]>, David Jacot <[email protected]>
…ception (apache#11504) This patch ensures that SocketChannel in Acceptor#accept is closed if an IOException is thrown while the socket is configured. Reviewers: Luke Chen <[email protected]>, David Jacot <[email protected]>
… closed upon IOException (apache#11504) This patch ensures that SocketChannel in Acceptor#accept is closed if an IOException is thrown while the socket is configured. Reviewers: Luke Chen <[email protected]>, David Jacot <[email protected]>
… closed upon IOException (apache#11504) This patch ensures that SocketChannel in Acceptor#accept is closed if an IOException is thrown while the socket is configured. Reviewers: Luke Chen <[email protected]>, David Jacot <[email protected]>
… closed upon IOException (apache#11504) (#486) This patch ensures that SocketChannel in Acceptor#accept is closed if an IOException is thrown while the socket is configured. Reviewers: Luke Chen <[email protected]>, David Jacot <[email protected]> Co-authored-by: Haoze Wu <[email protected]>
A patch for KAFKA-13457
Committer Checklist (excluded from commit message)