Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tarekgh opened this issue May 22, 2023 · 1 comment

Comments

@tarekgh
Copy link
Member

tarekgh commented May 22, 2023

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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 22, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 22, 2023
@tarekgh tarekgh self-assigned this May 22, 2023
@SingleAccretion SingleAccretion removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 22, 2023
@tarekgh tarekgh added this to the 8.0.0 milestone May 22, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label May 22, 2023
@tarekgh tarekgh added the untriaged New issue has not been triaged by the area owner label May 22, 2023
@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label May 23, 2023
@tarekgh
Copy link
Member Author

tarekgh commented May 26, 2023

This is addressed by #86740

@tarekgh tarekgh closed this as completed May 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants