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

Resolves issue with unexpected InvalidOperationExceptions #32

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

NorekZ
Copy link
Contributor

@NorekZ NorekZ commented Jun 18, 2024

Hello.

This PR resolves issue #30.

The problem is that DiagnosticsActivityEventSubscriber wants to return previously captured current activity to Activity.Current property again. In the Activity.Current setter there is a check that fails when the activity is stopped. When the "parent" activity is stopped in the meanwhile, exception is thrown.

The same code raises the exception also when you call a sync version of a mongo command. In this case, command's activity is the same as the Activity.Current activity. Inside action(), activity gets stopped, and afterwards activity is again assigned to Activity.Current property.

Both issues should be fixed by this PR.

Thanks.

@jbogard jbogard merged commit d12c19d into jbogard:master Aug 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants