drcrallen commented on a change in pull request #5913: Move Caching Cluster Client to java streams and allow parallel intermediate merges URL: https://github.com/apache/incubator-druid/pull/5913#discussion_r206350473
########## File path: java-util/src/main/java/io/druid/java/util/common/concurrent/Execs.java ########## @@ -147,4 +151,30 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) } ); } + + private static final LongAdder fjpWorkerThreadCount = new LongAdder(); Review comment: I think a better argument here is that the code has a race condition as is. ``` fjpWorkerThreadCount.increment(); t.setName(StringUtils.nonStrictFormat(name, fjpWorkerThreadCount.longValue())); ``` should take the state after the increment instead of relying on longValue. Since there is state management instead of pure accumulation it makes sense to have an atomic state class, like `AtomicLong` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org