Skip to content

2.x: FlowableTimeoutTimed enhancement #5461

@davidmoten

Description

@davidmoten

I'm debugging a production problem where a timeout did not fire so having a close look at FlowableTimeoutTimed. I notice in TimeoutTimedSubscriber that multiple terminal events can be emitted to the downstream subscriber in race between the scheduled timeout runnable and the onError and onComplete methods. The volatile done flag doesn't provide complete protection unless we turn it into an AtomicBoolean and use compareAndSet.

The other thing I notice is that the timer field is accessed synchronously (only via onSubscribe and onNext) so rather than an AtomicReference can be a mutable field.

I can make PR if you think these are valid.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions