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

JerryXin commented on HADOOP-11136:
-----------------------------------

I am running into this problem in ACTIVE mode.When you open a FTPInputStream 
and never use it, the  method will be blocked by  
client.completePendingCommand().
Could we just add wrappedStream.close() before boolean cmdCompleted = 
client.completePendingCommand()?
Or We can use pos check if the FTPInputStream has been read or not,if read ,we 
call method client.completePendingCommand(),if not,we simply ignore it?

> FTPInputStream should close wrapped stream
> ------------------------------------------
>
>                 Key: HADOOP-11136
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11136
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>            Reporter: Dzianis Sokal
>
> This is reproducible in PASSIVE FTP mode, which is not supported by 
> now(HADOOP-11135). However if we hack FTPFileSystem to enter into local 
> passive mode, it will hang on client.completePendingCommand() in 
> FTPInputStream line 114:
> {code}
> ...
> public synchronized void close() throws IOException {
> ...
> boolean cmdCompleted = client.completePendingCommand();
> ...
> {code}
> Going to completePendingCommand() docs I see that the stream should be closed 
> before calling it. So seems like stream should be closed
> {code}
> wrappedStream.close();
> {code}
> right before 
> {code}
> boolean cmdCompleted = client.completePendingCommand();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to