5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-04 06:22:46 +08:00

SQOOP-854: Return value of pg_bulkload utility is being ignored

(Jarek Jarcec Cecho via Cheolsoo Park)
This commit is contained in:
Cheolsoo Park 2013-01-30 15:55:26 -08:00
parent 9de589e83c
commit 144d31e62a

View File

@ -206,11 +206,16 @@ protected void cleanup(Context context)
thread.join(); thread.join();
} finally { } finally {
// block until the process is done. // block until the process is done.
int result = 0;
if (null != process) { if (null != process) {
while (true) { while (true) {
try { 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) { } catch (InterruptedException ie) {
// interrupted; loop around. // interrupted; loop around.
continue; continue;