diff --git a/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java b/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java index 14d064a5..5ba2b6ba 100644 --- a/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java +++ b/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java @@ -206,11 +206,16 @@ protected void cleanup(Context context) thread.join(); } finally { // block until the process is done. - int result = 0; if (null != process) { while (true) { try { - result = process.waitFor(); + int returnValue = process.waitFor(); + + // Check pg_bulkload's process return value + if (returnValue != 0) { + throw new RuntimeException( + "Unexpected return value from pg_bulkload: "+ returnValue); + } } catch (InterruptedException ie) { // interrupted; loop around. continue;