You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "vinoyang (JIRA)" <ji...@apache.org> on 2018/05/13 08:01:00 UTC

[jira] [Commented] (FLINK-9347) BlobServerConnection throws misleading exception for empty files

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

vinoyang commented on FLINK-9347:
---------------------------------

[~Zentol] which solution you prefer? I found the readLength method calling in BlobInputStream's constructor seems never return a negative number. And if it throws a EOFException that means the file is empty?

> BlobServerConnection throws misleading exception for empty files
> ----------------------------------------------------------------
>
>                 Key: FLINK-9347
>                 URL: https://issues.apache.org/jira/browse/FLINK-9347
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime
>    Affects Versions: 1.5.0
>            Reporter: Chesnay Schepler
>            Assignee: vinoyang
>            Priority: Trivial
>
> When downloading a file from the blob server that has a file size of 0 the following exception occurs on the server:
> {code}
> java.io.EOFException: Received invalid result value. -1
> 	at org.apache.flink.runtime.blob.BlobServerConnection.get(BlobServerConnection.java:275)
> 	at org.apache.flink.runtime.blob.BlobServerConnection.run(BlobServerConnection.java:117)
> {code}
> The reason is that the client cannot differentiate between a download with no more available data and an empty file, causing it to exit early in {{BlobInputStream#read}} without writing back {{RETURN_OKAY}}.
> This isn't necessarily a _problem_ in that sense as the file is properly created on the client, but the exception is a tad misleading and may lead debugging efforts down the wrong track (as has happened to me...).
> We should either fail early for empty files, fix the behavior, or at the very least at some warning log messages.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)