From 066f98aee04142e30abe7842b6d0a00e40677307 Mon Sep 17 00:00:00 2001 From: Jarek Jarcec Cecho Date: Wed, 2 Oct 2013 09:14:31 -0700 Subject: [PATCH] SQOOP-1210: Exporting data with malformed records causes sqoop2 jobs to hang until killed or they timeout (Venkat Ranganathan via Jarek Jarcec Cecho) --- .../sqoop/job/mr/SqoopOutputFormatLoadExecutor.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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(); + } } }