Skip to content

[Tracking] Figure out how we should handle the disposing of the meters created from meter factory #86592

Closed

Description

@tarekgh

The IMeterFactory interface offers the Create method for generating a Meter instance. We supply the default implementation of the meter factory, which utilizes this method to create meters. However, an issue arises as Meters are disposable objects, and we assert that the factory should be responsible for managing the lifetime of the meters it creates. Users who employ the factory to generate meters may mistakenly consider it to be disposable and attempt to dispose of it. We are currently tracking this issue to determine the most appropriate resolution.

Here are a couple of suggestions to address the issue:

  • Modify the returned meters' disposal behavior to be a no-op, ensuring that no adverse effects occur even if users attempt to dispose of them.
  • Rename the Create method to something like Get to convey to users that the returned objects should not be disposed.

Consider implementing one or both of these ideas to mitigate the problem and provide clearer guidance to users.

Activity

  1. ghost added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on May 22, 2023
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on May 22, 2023
  3. self-assigned this
    on May 22, 2023
  4. removed
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on May 22, 2023
  5. added this to the 8.0.0 milestone on May 22, 2023
  6. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on May 22, 2023
  7. added
    untriagedNew issue has not been triaged by the area owner
    on May 22, 2023
  8. removed
    untriagedNew issue has not been triaged by the area owner
    on May 23, 2023
  9. tarekgh commented on May 26, 2023

    @tarekgh
    MemberAuthor

    This is addressed by #86740

  10. ghost locked as resolved and limited conversation to collaborators on Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions