-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Fix the bug that cache doesn't unsubscribe the source Observable when th... #2238
Conversation
… the source is terminated
non-determistic failures
|
Drop: does it fail locally if run in a loop? Based on the test, it is possible a bogged down system can make it fail because everyone is slow enough so the drop is never triggered. Retry: how many seconds does this single test take on your computer? |
It's fine in my computer. The error was reported by Travis CI. |
It has 10 seconds timeout. If it takes 6 on your computer, then it is possible the Travis server is just slow this time. |
Misread your comment. These two test cases are fine in my computer. I just copied the errors from Travis CI log. |
I managed to run the original code in #2191 and putting the sleep after the thread.start will use only a handful of io() threads. It confirms my suspicion that the original code simply floods the system with threaded activities and does not give them enough time to finish. If the upstream completes, it should let any downstream object go (i.e., a completed ReplaySubject will throw away all of its subscribers). I've changed the code to allocate a large object and a memory dump right after the thread has completed shows no object retention. I don't see any issues here so could you elaborate on this issue/change (or on #2455)? |
I'm confused. This is not a memory leak bug. Instead, it's a bug that Because @Override
public void unsubscribe() {
if (ONCE_UPDATER.compareAndSet(this, 0, 1)) {
// unsubscribe should be idempotent, so only do this once
CachedWorkerPool.INSTANCE.release(threadWorker);
}
innerSubscription.unsubscribe();
} Then, the worker won't be put back into the |
Thanks, that makes sense now. |
Fix the bug that cache doesn't unsubscribe the source Observable when th...
...e source is terminated
Fix #2191