[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126020#comment-13126020
 ] 

Patrick Hunt commented on ZOOKEEPER-737:
----------------------------------------

How's this? 

One option that would make this a lot less ugly would be to deprecate support 
for 4letterwords on the client port in 3.5.0 (dep, not remove, although provide 
an option to turn off via config), we'd designate a new port specifically for 
4letterwords. We'd fix this problem on the new port, the old port would have 
the existing limitations.

3.6.0 we would remove 4lw on client port entirely.

This is good for a number of reasons IMO -- one is that having 4lw on the 
client port is a bit of a security issue in some customers - as any client has 
access to this port and it cannot by definition be firewalled. Many admins 
would like to firewall this.

In the process we could:
1) make the new port fully b/w compatible with the existing functionality
2) enable long lived sessions rather than polling
3) provide support for "extended command syntax" which would enhance 4lw 
features (for example to control the format of the output)
4) etc...

I realize this doesn't fix the existing, but it does provide for a reasonable 
way forward -- we'll pay off some debt.

                
> some 4 letter words may fail with netcat (nc)
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-737
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-737
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.3.0
>            Reporter: Patrick Hunt
>            Assignee: Mahadev konar
>            Priority: Blocker
>             Fix For: 3.3.1, 3.4.0
>
>         Attachments: ZOOKEEPER-737.patch, ZOOKEEPER-737.patch, 
> ZOOKEEPER-737.patch, ZOOKEEPER-737.patch, ZOOKEEPER-737.patch, 
> ZOOKEEPER-737.patch, ZOOKEEPER-737.patch
>
>
> nc closes the write channel as soon as it's sent it's information, for 
> example "echo stat|nc localhost 2181"
> in general this is fine, however the server code will close the socket as 
> soon as it receives notice that nc has
> closed it's write channel. if not all the 4 letter word result has been 
> written back to the client yet, this will cause
> some or all of the result to be lost - ie the client will not see the full 
> result. this was introduced in 3.3.0 as part
> of a change to reduce blocking of the selector by long running 4letter words.
> here's an example of the logs from the server during this
> echo -n stat | nc localhost 2181
> 2010-04-09 21:55:36,124 - INFO  
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory@251] - 
> Accepted socket connection from /127.0.0.1:42179
> 2010-04-09 21:55:36,124 - INFO  
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@968] - Processing 
> stat command from /127.0.0.1:42179
> 2010-04-09 21:55:36,125 - WARN  
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@606] - 
> EndOfStreamException: Unable to read additional data from client sessionid 
> 0x0, likely client has closed socket
> 2010-04-09 21:55:36,125 - INFO  
> [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1286] - Closed 
> socket connection for client /127.0.0.1:42179 (no session established for 
> client)
> [phunt@gsbl90850 zookeeper-3.3.0]$ 2010-04-09 21:55:36,126 - ERROR 
> [Thread-15:NIOServerCnxn@422] - Unexpected Exception: 
> java.nio.channels.CancelledKeyException
>       at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
>       at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:59)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn.sendBuffer(NIOServerCnxn.java:395)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$SendBufferWriter.checkFlush(NIOServerCnxn.java:907)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$SendBufferWriter.flush(NIOServerCnxn.java:945)
>       at java.io.BufferedWriter.flush(BufferedWriter.java:236)
>       at java.io.PrintWriter.flush(PrintWriter.java:276)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$2.run(NIOServerCnxn.java:1089)
> 2010-04-09 21:55:36,126 - ERROR [Thread-15:NIOServerCnxn$Factory$1@82] - 
> Thread Thread[Thread-15,5,main] died
> java.nio.channels.CancelledKeyException
>       at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
>       at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:64)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$SendBufferWriter.wakeup(NIOServerCnxn.java:927)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$SendBufferWriter.checkFlush(NIOServerCnxn.java:909)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$SendBufferWriter.flush(NIOServerCnxn.java:945)
>       at java.io.BufferedWriter.flush(BufferedWriter.java:236)
>       at java.io.PrintWriter.flush(PrintWriter.java:276)
>       at 
> org.apache.zookeeper.server.NIOServerCnxn$2.run(NIOServerCnxn.java:1089)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to