Skip to content

tower::Balance does not notice if multiple become ready at once #824

@c98

Description

@c98

tower-0.5.2

Platform: linux

In the process of using tonic, I found that its dynamic endpoint uses tower. I found a problem in actual use. When <Balance as Service>::poll_ready is triggered, Balance::promote_pending_to_ready=>ReadyCache::poll_pending=>futures_util::stream::futures_unordered::FuturesUnordered::poll_next has an issue: assuming there are multiple endpoints, only one Poll::Ready(Some(Ok((key, svc, cancel_rx)))) will be returned here, and the others are Poll::Pending, which makes the balance function invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-balanceArea: The tower "balance" middlewareS-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions