You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "sam rash (JIRA)" <ji...@apache.org> on 2010/04/20 11:39:53 UTC

[jira] Created: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

HftpFileSystem : errors during transfer result in truncated transfer
--------------------------------------------------------------------

                 Key: HDFS-1102
                 URL: https://issues.apache.org/jira/browse/HDFS-1102
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: data-node, hdfs client
    Affects Versions: 0.20.1
            Reporter: sam rash


If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859279#action_12859279 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-1102:
----------------------------------------------

>> It would be nice if we can fix this without changing the hftp protocol.
>
> any idea on how this can be done?

I think this is a programming bug.  RuntimeException is not handled correctly; see also [this comment|https://issues.apache.org/jira/browse/HDFS-1085?focusedCommentId=12855012&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12855012].

> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859030#action_12859030 ] 

dhruba borthakur commented on HDFS-1102:
----------------------------------------

> It would be nice if we can fix this without changing the hftp protocol.

any idea on how this can be done?

> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "sam rash (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858750#action_12858750 ] 

sam rash commented on HDFS-1102:
--------------------------------

proposed solution:

StreamFile: Datanode will set the content length in the header
HftpInputStream: read() method will verify that when underlying input stream from the http connection returns -1 that it has all the bytes, else throws an EOFException


> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "sam rash (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858748#action_12858748 ] 

sam rash commented on HDFS-1102:
--------------------------------

the log entry in the datanode:

2010-04-19 16:42:59,072 ERROR org.mortbay.log: /streamFile
java.nio.channels.CancelledKeyException
        at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
        at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:59)
        at org.mortbay.io.nio.SelectChannelEndPoint.updateKey(SelectChannelEndPoint.java:324)
        at org.mortbay.io.nio.SelectChannelEndPoint.blockWritable(SelectChannelEndPoint.java:278)
        at org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(AbstractGenerator.java:542)
        at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:569)
        at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:946)
        at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:646)
        at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:577)
        at org.apache.hadoop.hdfs.server.namenode.StreamFile.doGet(StreamFile.java:73)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1124)
        at org.apache.hadoop.http.HttpServer$QuotingInputFilter.doFilter(HttpServer.java:669)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)


> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "sam rash (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859171#action_12859171 ] 

sam rash commented on HDFS-1102:
--------------------------------

actually, i was discussing this with another friend and they pointed out that we don't even need to change how hftp works.  even w/chunked encoding, we should be able to verify on the client since it'll send:


size1\n
<size1 bytes>

size2\n
<size2 bytes>

0

if we don't see fewer than size_N bytes or do not see the 0, we missed data.  the underlying http client *should* handle this. if not, we can switch to:

http://hc.apache.org/

which apparently is better than using java.net.URL's underlying connection client.



> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "Koji Noguchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Koji Noguchi resolved HDFS-1102.
--------------------------------

    Resolution: Duplicate

Duplicate of HDFS-1085.   It would be nice if we can fix this without changing the hftp protocol.

> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "sam rash (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859394#action_12859394 ] 

sam rash commented on HDFS-1102:
--------------------------------

hmm, that's a server side exception.  it happens when the selection key is no longer valid (ie the channel has been closed, maybe due to a timeout).  in this case, i don't know what could be done server side...?

I think the appropriate fix is on the client side to detect this timeout.  i think changing to use the client I mention above in HftpFileSystem might alleviate the silent failures.

> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HDFS-1102) HftpFileSystem : errors during transfer result in truncated transfer

Posted by "sam rash (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859056#action_12859056 ] 

sam rash commented on HDFS-1102:
--------------------------------

well, it's not w/o modifying hftp, but a client can verify the content length if it's there, and proceed as it does now if it's not present.

we could also have a config option that say "enforce content length" which would cause missing content length => throw IOException.

in this way, if both the client and server are on the latest hftp, this works, else it will work as before

offhand, i'm not sure how to do this without either changing hftp or wrapping it in some other protocol that does length checking

> HftpFileSystem : errors during transfer result in truncated transfer
> --------------------------------------------------------------------
>
>                 Key: HDFS-1102
>                 URL: https://issues.apache.org/jira/browse/HDFS-1102
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: data-node, hdfs client
>    Affects Versions: 0.20.1
>            Reporter: sam rash
>
> If an error occurs transferring the data over HTTP, the HftpInputStream does not know it received fewer bytes than the file contains.  We can at least detect this and throw an EOFException when this occurs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.