[ https://issues.apache.org/jira/browse/ZOOKEEPER-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897852#action_12897852 ]
Patrick Hunt commented on ZOOKEEPER-845: ---------------------------------------- Agree, this is ugly, however if you look the issue is related to the fact that nio uses threads while netty doesn't. One question in my mind, should netty be using a thread as well? The problem is that the channel could be closed before netty responds if the response is not handled in the worker request thread. In NIO we handle this by "handing off" ownership of the socket from the main run routine to the 4lw response thread. afaik we cannot do this in netty. So really it's not a simple answer afaict. That's why I didn't do it cleanly in the first place. > remove duplicate code from netty and nio ServerCnxn classes > ----------------------------------------------------------- > > Key: ZOOKEEPER-845 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-845 > Project: Zookeeper > Issue Type: Improvement > Components: server > Reporter: Benjamin Reed > > the code for handling the 4-letter words is duplicated between the nio and > netty versions of ServerCnxn. this makes maintenance problematic. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.