diff --git a/finagle-stats-core/src/main/scala/com/twitter/finagle/stats/MetricsStatsReceiver.scala b/finagle-stats-core/src/main/scala/com/twitter/finagle/stats/MetricsStatsReceiver.scala index 6d39af3388a..7918b84fc25 100644 --- a/finagle-stats-core/src/main/scala/com/twitter/finagle/stats/MetricsStatsReceiver.scala +++ b/finagle-stats-core/src/main/scala/com/twitter/finagle/stats/MetricsStatsReceiver.scala @@ -6,6 +6,7 @@ import com.twitter.finagle.util.DefaultTimer import com.twitter.logging.{Level, Logger} import com.twitter.util.{Future, FuturePool, Time} import com.twitter.util.lint.{Category, GlobalRules, Issue, Rule} +import java.util.concurrent.Executor import java.util.concurrent.atomic.LongAdder import scala.collection.JavaConverters._ @@ -53,6 +54,12 @@ class MetricsStatsReceiver(val registry: Metrics) with CollisionTrackingStatsReceiver with WithHistogramDetails { + /** + * Overrides the executor that manages cumulative gauges to use the same + * executor that backs FuturePool.unboundedPool. + */ + override def executor: Executor = FuturePool.defaultExecutor + import MetricsStatsReceiver._ def this() = this(MetricsStatsReceiver.defaultRegistry)