dlmarion commented on a change in pull request #1818:
URL: https://github.com/apache/accumulo/pull/1818#discussion_r543514934
##########
File path:
core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReader.java
##########
@@ -72,16 +72,15 @@ protected TabletServerBatchReader(ClientContext context,
Class<?> scopeClass, Ta
queryThreadPool = ThreadPools.getFixedThreadPool(numQueryThreads,
"batch scanner " + batchReaderInstance + "-", false);
+ // Call shutdown on this thread pool in case the caller does not call
close().
cleanable = CleanerUtil.shutdownThreadPoolExecutor(queryThreadPool, log);
}
@Override
public void close() {
if (closed.compareAndSet(false, true)) {
- // deregister cleanable, but it won't run because it checks
- // the value of closed first, which is now true
- cleanable.clean();
queryThreadPool.shutdownNow();
+ cleanable.clean();
Review comment:
So we really only need `cleanable.clean()` here as it deregisters *and*
invokes the cleaning action.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]