Skip to content

Outer groupBy doesn't obey backpressure #3425

Closed
@abersnaze

Description

@abersnaze

Someone here brought by some code that was throwing a MissingBackpressureException. Aaron and I narrowed it down to this snippet.

merge(range(0, 500).groupBy(i -> i % (RxRingBuffer.SIZE + 2)).observeOn(computation())).toBlocking().last()

it comes down observeOn requesting 128 Observables from groupBy and groupBy hard coded to request 1024 from range.

We fixed his problem changing the observeOn(computation()) to flatMap(grp -> grp.subscribeOn(computation()))2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions