michaelandrepearce commented on a change in pull request #2517: [ARTEMIS-2171]:
ThreadPoolExecutor leak under SM due to lack of privileged block.
URL: https://github.com/apache/activemq-artemis/pull/2517#discussion_r250700525
##########
File path:
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/DBOption.java
##########
@@ -223,13 +225,17 @@ protected void initializeJournal(Configuration
configuration) throws Exception {
this.config = configuration;
executor = Executors.newFixedThreadPool(5,
ActiveMQThreadFactory.defaultThreadFactory());
executorFactory = new OrderedExecutorFactory(executor);
-
- scheduledExecutorService = new
ScheduledThreadPoolExecutor(configuration.getScheduledThreadPoolMaxSize(), new
ThreadFactory() {
+ scheduledExecutorService = new
ScheduledThreadPoolExecutor(configuration.getScheduledThreadPoolMaxSize(),
AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() {
@Override
- public Thread newThread(Runnable r) {
- return new Thread(r);
+ public ThreadFactory run() {
Review comment:
I know this inst your change, but it highlights a bigger question, as to why
is this not using ActiveMQThreadFactory?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services