Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-7430

ContinuousFileReaderOperator swallows exceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.3.2, 1.4.0
    • 1.4.0
    • None
      • macOS 10.12.6
      • Oracle JDK 1.8.0_144
      • Flink 1.3.2

    Description

      The class ContinuousFileReaderOperator is swallowing exceptions as the following example demonstrates:

      package org.apache.flink.streaming.examples;
      
      import java.io.File;
      import java.io.IOException;
      
      import org.apache.flink.api.common.io.OutputFormat;
      import org.apache.flink.configuration.Configuration;
      import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
      
      public class FormatExceptionSwallowed {
      	public static void main(String[] args) throws Exception {
      		final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
      		File bla = File.createTempFile("foo", "baz");
      		try(PrintWriter w = new PrintWriter(bla)) {
      			w.println("one");
      			w.println("two");
      			w.println("three");
      		}
      		env.readTextFile(bla.getCanonicalPath())
      			.writeUsingOutputFormat(new OutputFormat<String>() {
      				@Override
      				public void configure(final Configuration parameters) {
      				}
      				@Override
      				public void open(final int taskNumber, final int numTasks) throws IOException {
      				}
      				@Override
      				public void writeRecord(final String record) throws IOException {
      					throw new IllegalArgumentException("bla");
      				}
      				@Override
      				public void close() throws IOException {
      				}
      			});
      		env.execute("go");
      		
      		// JOB TERMINATES WITH NO EXCEPTION / ERROR whatsoever ... 
      	}
      }
      
      

      Attachments

        Issue Links

          Activity

            People

              trohrmann Till Rohrmann
              pete Peter Ertl
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: