Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-16470

OpenTelemetry Instance Leak in OpenTelemetryClientRequestFilter

    XMLWordPrintable

Details

    • Hide

      A reproducer is available here: https://github.com/Spindl/WFLY-16470_reproducer

      How to run the reproducer

      1. Build everything by running mvn clean install
      2. Run the server with java -Xmx64m -jar server/target/server-local-SNAPSHOT-bootable.jar
        1. It's not strictly necessary to limit the heap space, but this way it's easier to spot the leaked instances in a dump
        2. Also the client will be done faster with filling the heap
      3. Run the client with java client/src/main/java/com/nts/reproducer/client/Main.java

      The client will fill the server heap up to a configured threshold value.

      Show
      A reproducer is available here: https://github.com/Spindl/WFLY-16470_reproducer How to run the reproducer Build everything by running  mvn clean install Run the server with  java -Xmx64m -jar server/target/server-local-SNAPSHOT-bootable.jar It's not strictly necessary to limit the heap space, but this way it's easier to spot the leaked instances in a dump Also the client will be done faster with filling the heap Run the client with  java client/src/main/java/com/nts/reproducer/client/Main.java The client will fill the server heap up to a configured threshold value.
    • ---
    • ---

    Description

      When migrating from opentracing to opentelemetry, we checked out the available API and found a problematic code snippet that causes a memory leak. (pretty much the same as in this issue: https://issues.redhat.com/browse/WFLY-16256)

      We are using WildFly 26.1.1.Final.

      This time around it's even worse because a new instance is created with every request done with a traced client, and there is no way to disable the tracing since the filter is added automatically.

      Here is a Screenshot of a heap dump. Almost all of the 130 007 elements are contextual instances containing the same OpenTelemetrySdk.

      Attachments

        Activity

          People

            jaslee@redhat.com Jason Lee
            roland.spindelbalker@ntsretail.com Roland Spindelbalker-Davila
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: