You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Dispatcher interface provides overloaded unsubscribe methods, unfortunately it is quite easy for someone to choose the incorrect method and this doesn't produce any kind of error but has the potentially dangerous side-effect of not actually closing the subscription. Please consider throwing an exception or at least logging a warning in the library when unsubscribe is used this way and the subscription is not found on the default handler.
In the example above, the unsubscribe call does not throw but also it does not actually unsubscribe. In applications that manage subscriptions dynamically, this can result in a huge number of subscriptions being quietly left open on the server resulting in performance degradation and eventual OOM. The mistake is also easily missed in code review and by static analysis tools. The behavior is also difficult to validate in tests because the library does not provide a way to check the number of active subscriptions.
Contribution
No response
The text was updated successfully, but these errors were encountered:
Proposed change
The Dispatcher interface provides overloaded
unsubscribe
methods, unfortunately it is quite easy for someone to choose the incorrect method and this doesn't produce any kind of error but has the potentially dangerous side-effect of not actually closing the subscription. Please consider throwing an exception or at least logging a warning in the library when unsubscribe is used this way and the subscription is not found on the default handler.Use case
In the example above, the unsubscribe call does not throw but also it does not actually unsubscribe. In applications that manage subscriptions dynamically, this can result in a huge number of subscriptions being quietly left open on the server resulting in performance degradation and eventual OOM. The mistake is also easily missed in code review and by static analysis tools. The behavior is also difficult to validate in tests because the library does not provide a way to check the number of active subscriptions.
Contribution
No response
The text was updated successfully, but these errors were encountered: