Skip to content

Recursive scheduler fails to unsubscribe from time to time (RxJava 15.1 on Android) #758

Closed
@lexer

Description

@lexer
  Scheduler threadPoolScheduler = Schedulers.executor(Executors.newFixedThreadPool(3));

  Subscription subscription = threadPoolScheduler.schedule(0L, new Func2<Scheduler, Long, Subscription>() {

                @Override
                public Subscription call(Scheduler inner, Long t2) {
                    return inner.schedule(t2, this, 1000, TimeUnit.MILLISECONDS);
                }
            });
        }

    });

   // unsubscribe when app worked several hours:
  subscription.unsubscribe()

It seems that current implementation of recursive scheduler become unstable when it accumulates too much subscriptions. May be subscriptions should not be accumulated and be substituted instead.

rx.util.CompositeException: Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed to unsubscribe to 1 or more subscriptions. => , CompositeException:Failed t

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions