-
Notifications
You must be signed in to change notification settings - Fork 317
Cleanup | Convert SniLoadHandle to static class #3768
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
Cleanup | Convert SniLoadHandle to static class #3768
Conversation
This replaces a ThreadLocal<T> value (which we would need to dispose of) with a simpler [ThreadStatic] variable.
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
@edwardneal This will need a rebase/merge from main to pickup the new PR pipeline configs. |
|
Thanks @paulmedynski I've just merged main. |
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3768 +/- ##
==========================================
- Coverage 76.59% 69.95% -6.65%
==========================================
Files 274 268 -6
Lines 43395 43075 -320
==========================================
- Hits 33240 30134 -3106
- Misses 10155 12941 +2786
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This PR fixes a minor correctness issue and might also contribute to #1687 - this field was one of several lingering on the heap when trying to unload a collectible AssemblyLoadContext.
The managed SNI's
SniLoadHandlecurrently has a per-threadLastErrorproperty which references aThreadLocal<SniError>. ThreadLocal is disposable, but we have no clear opportunity to dispose of it when the AssemblyLoadContext is unloaded.The entire class is a singleton which only exposes a single meaningful property,
LastError. I've converted SniLoadHandle into a static class, then replaced theThreadLocalwith a simpler[ThreadStatic]variable.Issues
Related to #1687. It doesn't fix the issue, but it's one of the two fixes which are easiest to pick out from a broader set of changes.
Testing
Automated tests continue to pass.