-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Catch() and its shared subscriptions #763
Comments
At immediate sight, I'd expect each subscription unsubscribed when next subscription starts, like below.
|
staltz
added a commit
to staltz/RxJSNext
that referenced
this issue
Nov 24, 2015
Fix catch operator to not have anymore a shared underlying Subscription, and instead reset the subscription for each new observable replacing the caught error. This fixes a potential memory leak if catch is used as an infinite retry, because subscriptions would be retained since the beginning, and would increasing each time a catch is performed. Resolves issue ReactiveX#763.
I believe so (though I'm not @staltz :) ) PR still need to be merged though. |
staltz
added a commit
to staltz/RxJSNext
that referenced
this issue
Nov 30, 2015
Fix catch operator to not have anymore a shared underlying Subscription, and instead reset the subscription for each new observable replacing the caught error. This fixes a potential memory leak if catch is used as an infinite retry, because subscriptions would be retained since the beginning, and would increasing each time a catch is performed. Resolves issue ReactiveX#763.
okay... reopening until the merge. |
kwonoj
pushed a commit
that referenced
this issue
Nov 30, 2015
Fix catch operator to not have anymore a shared underlying Subscription, and instead reset the subscription for each new observable replacing the caught error. This fixes a potential memory leak if catch is used as an infinite retry, because subscriptions would be retained since the beginning, and would increasing each time a catch is performed. Resolves issue #763.
Now really closing issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When writing tests for catch(), I noticed this behavior:
Special attention given to this part:
This happens because CatchSubscriber does
As a consequence, if someone uses
source.catch(e => source)
as a flavor ofretry()
, the number of subscriptions will indefinitely grow and stay retained.What do you think should be done about this behavior?
The text was updated successfully, but these errors were encountered: