#2778 - make thread names unique per system

The MonitorableThreadFactory.copy method does not take into account the
counter:AtomicLong field, which then always starts out at zero for every
new dispatcher; the PinnedDispatcher creates one dispatcher per actor,
hence resulting in identical thread names if used by multiple actors.
Solution: add the counter to the case class’ arguments
This commit is contained in:
Roland 2012-12-06 22:50:40 +01:00
parent cd0fa5aee2
commit 6450831e01
5 changed files with 9 additions and 7 deletions

View file

@ -95,7 +95,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
new DefaultScheduler(
new HashedWheelTimer(log,
system.threadFactory match {
case tf: MonitorableThreadFactory tf.copy(name = tf.name + "-cluster-scheduler")
case tf: MonitorableThreadFactory tf.withName(tf.name + "-cluster-scheduler")
case tf tf
},
SchedulerTickDuration,