Skip to content

Buffered and BufferUnordered do not always reach to max concurrency #2961

@andylokandy

Description

@andylokandy

Problem Description:
When FuturesUnordered is polled, the first ready value is immediately returned, leaving other futures in ready_to_run_queue unpolled. This is problematic when those futures need to be polled to get started (e.g., sending requests to a server). For example, using reqs.buffered(10) is supposed to maintain 10 requests in flight or ready, but if some requests are ready and being processed, FuturesUnordered does not trigger the remaining requests to be sent.

This problem may also be found on ForEachConcurrent, FlattenUnordered, and other combinators utilizing FuturesUnordered. But I'm only focus on Buffered and BufferUnordered for now to get things started.

cc @taiki-e

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