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

ASF GitHub Bot commented on FLINK-5027:
---------------------------------------

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2765#discussion_r86813824
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java
 ---
    @@ -124,6 +124,9 @@ public void open(Configuration parameters) throws 
Exception {
        @Override
        public void run(SourceFunction.SourceContext<TimestampedFileInputSplit> 
context) throws Exception {
                FileSystem fileSystem = FileSystem.get(new URI(path));
    +           if (!fileSystem.exists(new Path(path))) {
    +                   throw new IOException("The provided file path " + path 
+ " does not exist.");
    --- End diff --
    
    I think we should throw an `FileNotFoundException` which better reflects 
the reason of the error.


> FileSource finishes successfully with a wrong path
> --------------------------------------------------
>
>                 Key: FLINK-5027
>                 URL: https://issues.apache.org/jira/browse/FLINK-5027
>             Project: Flink
>          Issue Type: Bug
>          Components: DataStream API
>    Affects Versions: 1.2.0
>            Reporter: Till Rohrmann
>            Assignee: Kostas Kloudas
>             Fix For: 1.2.0
>
>
> When reading from a non existing {{File}} or a wrong file path, a Flink 
> streaming program finishes successfully even though it should fail with a 
> appropriate error message. This can be misleading since the user is not 
> notified about the wrong file path. 
> I think the default behaviour should be that we fail a file streaming source 
> if the file path is wrong.



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

Reply via email to