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:
commit
0da4762073
1 changed files with 10 additions and 2 deletions
|
|
@ -337,10 +337,18 @@ private[akka] final class AffinityPoolConfigurator(config: Config, prerequisites
|
||||||
exception)
|
exception)
|
||||||
}).get
|
}).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 {
|
new ExecutorServiceFactory {
|
||||||
override def createExecutorService: ExecutorService =
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue