apache/hadoop-common — pull request #12 by hbjoylee (2013-12-19 07:15:09+00:00)
Title: Fix  CLOSE_WAIT When client request block to DataNode and IOException occurs

In DFSInputStream.blockSeekTo(),invoke getBlockReader() which wil generate a peer use newTcpPeer(dnAddr) ,when BlockReaderFactory.newBlockReader throw IOException,the peer will not be closed which will cause a CLOSE_WAIT connection.
In our test,when datanode get a InvalidToken exception in DataXceiver.checkAccess(),it will close the connection.At regionserver side, in RemoteBlockReader2.newBlockReader(),checkSuccess() will throw a InvalidBlockTokenException, DFSInputStream.blockSeekTo() will catch the exception, but the connection is NOT closed, it become CLOSE_WAIT.