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

Remove @RequestScope annotation from the OpenTelemetryContainerFilter

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 25.0.0.Final
    • None
    • OpenTelemetry
    • None

      The OpenTelemetryContainerFilter as a @RequestScope annotation on it. In most cases this should be fine. However, if this is ever ran from a ManagedThread the request scope will likely not be active.

      CDI beans can be used as tasks. Such tasks could make use of injection if they are themselves components or are created dynamically using various CDI APIs. However, application developers should be aware of the following when using CDI beans as tasks:

      • Tasks that are submitted to a managed instance of ExecutorService may still be running after the lifecycle of the submitting component. Therefore, CDI beans with a scope of @RequestScoped,
        @SessionScoped, or @ConversationScoped are not recommended to use as tasks as it cannot be guaranteed that the tasks will complete before the CDI context is destroyed.
      • CDI beans with a scope of @ApplicationScoped or @Dependent can be used as tasks. However, it is still possible that the task could be running beyond the lifecycle of the submitting component, such as when the component is destroyed.
      • The transitive closure of CDI beans that are injected into tasks should follow the above guidelines regarding their scopes.

      Jakarta REST Providers support CDI and therefore the annotation should not be required.

            jperkins-rhn James Perkins
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: