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

EventPipe session was not disposed upon stopping exception #208

Open
xiaomi7732 opened this issue Dec 7, 2023 · 0 comments
Open

EventPipe session was not disposed upon stopping exception #208

xiaomi7732 opened this issue Dec 7, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xiaomi7732
Copy link
Member

xiaomi7732 commented Dec 7, 2023

Describe the bug
Event pipe session isn't disposed when there's exception.

To Reproduce
Steps to reproduce the behavior:

For whatever reason, when there's exception, the event pipe session should be disposed upon stopping.

Expected behavior
Dispose being called upon exception.

...
                try
                {
                    if (_currentSession != null)
                    {
                        _...

                        if (disposeEventSessionImmediately)
                        {
                            DisposeEventPipeSession();
                        }
                    }

                    _logger.LogTrace("[{typeName}] Disabled.", _typeName);
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex, "Unexpected exception stopping session.");
                    // !!!!!! Dispose should have been called here !!!!!!!
                    throw;
                }
                finally
                {
                    _singleTraceSessionHandle.Release();
                }

The same should be done for start logic.

@xiaomi7732 xiaomi7732 self-assigned this Dec 7, 2023
@xiaomi7732 xiaomi7732 added bug Something isn't working and removed needs-triage labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant