Repository: sqoop Updated Branches: refs/heads/sqoop2 1bd26e7f3 -> c74dda1b2
SQOOP-1916: Sqoop2: Yarn child leaking in integration tests (Scott Kuehn via Abraham Fine) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/c74dda1b Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/c74dda1b Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/c74dda1b Branch: refs/heads/sqoop2 Commit: c74dda1b214d2f8794b651c8184f1d6bb4c1fbf5 Parents: 1bd26e7 Author: Abraham Fine <[email protected]> Authored: Mon Mar 14 19:49:18 2016 -0700 Committer: Abraham Fine <[email protected]> Committed: Mon Mar 14 19:49:18 2016 -0700 ---------------------------------------------------------------------- .../apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/c74dda1b/execution/mapreduce/src/main/java/org/apache/sqoop/job/mr/SqoopOutputFormatLoadExecutor.java ---------------------------------------------------------------------- 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 b283982..48bfb32 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 @@ -59,6 +59,7 @@ public class SqoopOutputFormatLoadExecutor { private JobContext context; private SqoopRecordWriter writer; private Future<?> consumerFuture; + private ExecutorService executorService; private Semaphore filled = new Semaphore(0, true); private Semaphore free = new Semaphore(1, true); private String loaderName; @@ -86,9 +87,9 @@ public class SqoopOutputFormatLoadExecutor { } public RecordWriter<SqoopWritable, NullWritable> getRecordWriter() { - consumerFuture = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat - ("OutputFormatLoader-consumer").build()).submit( - new ConsumerThread(context)); + executorService = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat + ("OutputFormatLoader-consumer").build()); + consumerFuture = executorService.submit(new ConsumerThread(context)); return writer; } @@ -162,6 +163,8 @@ public class SqoopOutputFormatLoadExecutor { } throw new SqoopException(MRExecutionError.MAPRED_EXEC_0019, ex); + } finally { + executorService.shutdownNow(); } }
