Skip to content

Commit 10df51a

Browse files
authored
Merge pull request jprante#944 from cxfly/master
fix the number of threads continue to grow problem
2 parents c70fab2 + ee7ec72 commit 10df51a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/xbib/tools/JDBCImporter.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ public void run() {
152152
logger.error(e.getMessage(), e);
153153
} finally {
154154
try {
155+
executorService.shutdown();
156+
if (!executorService.awaitTermination(15, TimeUnit.SECONDS)) {
157+
executorService.shutdownNow();
158+
if (!executorService.awaitTermination(15, TimeUnit.SECONDS)) {
159+
throw new IOException("pool did not terminate");
160+
}
161+
}
162+
155163
if (context != null) {
156164
context.shutdown();
157165
context = null;

0 commit comments

Comments
 (0)