Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Potential blocking issue when use tracing_unbounded channel to send Sender<T> #13849

@NingLin-P

Description

@NingLin-P

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

In #13504, the underlying channel of tracing_unbounded channel switched from futures-channel to async-channel.

In async-channel, the unconsumed messages of the channel will not drop even though all the receivers have been dropped and these messages can never be accessed smol-rs/async-channel#23, this behavior may be an issue when using tracing_unbounded channel to send Sender<T> to another worker and wait for receiving from this Sender<T> (like the usage mentioned at smol-rs/async-channel#23).

In autonomys/subspace#1352 (comment), we have encountered an issue with the abovementioned usage which causes our test block forever. I'm not quite familiar with the tracing_unbounded usage in substrate, but I do observe some use cases that use tracing_unbounded channel to send Sender<T> and they may be potential issues:

let (entries_tx, entries_rx) = tracing_unbounded("status-sinks-entries", 100_000);

let (tx, rx) = tracing_unbounded("mpsc_peerset_messages", 10_000);

let (tx, rx) = tracing_unbounded("mpsc_network_service_provider", 100_000);

let (tx, service_rx) = tracing_unbounded("mpsc_chain_sync", 100_000);

Steps to reproduce

See smol-rs/async-channel#23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions