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

Method StopBackgroundCleanUpLoop in class EtpProtocolHandler not thread safe #13

Closed
waveflight opened this issue Feb 28, 2022 · 0 comments

Comments

@waveflight
Copy link

In testing, encountered exception: Object reference not set to an instance of an object on line 1025 of the EtpProcolHandler class. Note that the check on line 1024 is not thread safe.

if (_backgroundCleanUpTask != null)
                    **AsyncContext.Run(() => _backgroundCleanUpTask.ConfigureAwait(Session.CaptureAsyncContext));**

There are 2 separate locations that the StopBackgroundCleanUpLoop method is called from. I did not investigate under what circumstances both will execute, but I suspect that this is how this exception is encountered. The simple fix for now is to make the StopBackgroundCleanUpLoop thread safe.

waveflight pushed a commit to waveflight/etp-devkit that referenced this issue Feb 28, 2022
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

No branches or pull requests

2 participants