Hi hadoopers,
Here is the exception that screwed up me on Saturday night and failed my Mapper task.
- Mapper is reading the lines one by one and tokenize it.
- The last token contains a path of a file in HDFS.
- I need to open the file and read the contents.
For the above task, following is the flow I followed in the Mapper.

Worse, my mapper failed with the following exception.
org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader@1cb3ec38
java.io.IOException: Filesystem closed
at org.apache.hadoop.hdfs.DFSClient.checkOpen(DFSClient.java:689)
at org.apache.hadoop.hdfs.DFSInputStream.close(DFSInputStream.java:617)
Filesystem object is suppose to be global. When I close the filesystem, the Mapper input is also closed which breaks the complete flow. So I closed only the filestream, but I didn’t close the file system explicitly which resolved the problem.
Ref: https://github.com/linkedin/gobblin/issues/1219