Skip to content

Errors not being delivered in Android Scheduler #1241

Closed
@vinc3m1

Description

@vinc3m1

I'm running into intermittent cases when using AndroidSchedulers.mainThread() (which is just a wrapper around AndroidSchedulers.handerThread()) where the onError event is not being delivered to the main thread.

I have a gist showing my logs: https://gist.github.com/vinc3m1/dc9232653a22f8f2d900

It seems the onError event is propagated all the way up until .observeOn(AndroidSchedulers.mainThread(). After which in some (seemingly random) cases it's not delivered. And the cause appears to be that innerSubscription is reporting itself to be unsubscribed.

So my main questions are:

  1. Should we even be doing the isUnsubscribed check on innerSubscription if we already have handler.removeCallbacks(runnable) to handle unsubscribe events?
  2. Should innerSubscription be reporting isUnsubscribed == true when nothing else is unsubscribing from it?

Also, I'm using rather complex combination of map, flatmap, and combineLatest upstream, is it possible that some combinations of these are causing innerSubscription to be unsubscribed?

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