Skip to content

Race condition with ReconnectableObservable #2

@ndglover

Description

@ndglover

Hi Dave,

I believe there is a race condition in the logic for Disposable versus new subscribers. I can't seem to reproduce it with a unit test using TestSchedulers. I can though using more realistic code (see attached), albeit not every time. What seems to happen is the RefCount drops to zero and the disposable is scheduled but not executed, subsequently a new subscriber comes in and gets the existing subject, then the subject is disposed beneath them and no more updates come though.

It only happens when you have a .SubscribeOn

Wondered if you had any thoughts on this?

Crude test code
CrudeTestCode.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions