diff --git a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java index 739eb17c..7dedee9f 100644 --- a/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java +++ b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java @@ -166,9 +166,16 @@ public Object readContent(int type) throws InterruptedException { if (writerFinished) { return null; } - Object content = data.getContent(type); - free.release(); - return content; + try { + Object content = data.getContent(type); + return content; + } catch (Throwable t) { + readerFinished = true; + LOG.error("Caught exception e while getting content ", t); + throw new SqoopException(MapreduceExecutionError.MAPRED_EXEC_0018, t); + } finally { + free.release(); + } } }