Skip to content

kamon-pekko: find new way to instrument pinned dispatchers #1366

@pjfanning

Description

@pjfanning

Relates to #1352

The existing ThreadPoolConfigCopyAdvice kamon-pekko doesn't work for Pekko 1.1 when Scala 2.13 is used. Pekko 1.1 has Scala 2 compiler inlining enabled. ThreadPoolConfig is a final case class and the copy function is derived by the Scala compiler. When a class is final, all its functions are final and can be inlined. Since the copy function is not explicitly declared, I haven't found a way to mark it as @noinline. I even tried adding the annotation to the case class.

  onType("org.apache.pekko.dispatch.ThreadPoolConfig")
    .mixin(classOf[HasDispatcherPrerequisites.Mixin])
    .advise(method("copy"), classOf[ThreadPoolConfigCopyAdvice])

Would it be feasible to try replacing this instrumentation point and concentrating on the PinnedDispatcher constructor instead?
https://github.com/apache/pekko/blob/22a738511375baa23c5b84c87d44a065c0401e0e/actor/src/main/scala/org/apache/pekko/dispatch/PinnedDispatcher.scala#L28

fyi @hughsimpson

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions