-
Notifications
You must be signed in to change notification settings - Fork 162
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
Dispose all subscriptions when connection broken #677
Conversation
…ptionManager is disposed
approvals? |
Whoops! Should be good now. |
@sungam3r Merge if it looks good to you. |
@sungam3r Ready for review here. |
src/Transports.Subscriptions.Abstractions/SubscriptionServer.cs
Outdated
Show resolved
Hide resolved
Just checked the code:
This may sound confusing, but I'm pretty sure it's all correct. |
Codecov Report
@@ Coverage Diff @@
## master #677 +/- ##
==========================================
- Coverage 52.44% 50.22% -2.23%
==========================================
Files 68 68
Lines 1779 1818 +39
Branches 172 183 +11
==========================================
- Hits 933 913 -20
- Misses 798 851 +53
- Partials 48 54 +6
Continue to review full report at Codecov.
|
This code ensures that all existing subscriptions are disposed when the connection is disposed. Of course if the shutdown is clean then there should be no difference. Also it prevents additional subscriptions from connecting after the connection is disposed. Also the subscription releases all held objects upon disposal - so in case the IObserverable does not properly release the observer after it is disposed, at least there won't be any held handles to the underlying WebSocket.