Merge pull request #24552 from RafalSumislawski/24544-name-affinity-pool-threads

#24544 Add dispatcher name to names of threads created by AffinityPool
This commit is contained in:
Johannes Rudolph 2018-03-05 17:18:00 +01:00 committed by GitHub
commit 0da4762073
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -337,10 +337,18 @@ private[akka] final class AffinityPoolConfigurator(config: Config, prerequisites
exception)
}).get
override def createExecutorServiceFactory(id: String, threadFactory: ThreadFactory): ExecutorServiceFactory =
override def createExecutorServiceFactory(id: String, threadFactory: ThreadFactory): ExecutorServiceFactory = {
val tf = threadFactory match {
case m: MonitorableThreadFactory
// add the dispatcher id to the thread names
m.withName(m.name + "-" + id)
case other other
}
new ExecutorServiceFactory {
override def createExecutorService: ExecutorService =
new AffinityPool(id, poolSize, taskQueueSize, threadFactory, idleCpuLevel, queueSelectorFactory.create(), rejectionHandlerFactory.create()).start()
new AffinityPool(id, poolSize, taskQueueSize, tf, idleCpuLevel, queueSelectorFactory.create(), rejectionHandlerFactory.create()).start()
}
}
}