Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy.toml: Create config and disallow unbounded channels #2823

Merged
merged 5 commits into from Aug 20, 2022

Commits on Aug 17, 2022

  1. clippy.toml: Create and disallow unbounded channels

    When using channels (e.g. `futures::channel::mpsc` or `std::sync::mpsc`)
    always use the bounded variant, never use the unbounded variant. When
    using a bounded channel, a slow consumer eventually slows down a fast
    producer once the channel bound is reached, ideally granting the slow
    consumer more system resources e.g. CPU time, keeping queues small and
    thus latencies low.  When using an unbounded channel a fast producer
    continues being a fast producer, growing the channel buffer
    indefinitely, increasing latency until the illusion of unboundedness
    breaks and the system runs out of memory.
    
    One may use an unbounded channel if one enforces backpressure through an
    out-of-band mechanism, e.g. the consumer granting the producer
    send-tokens through a side-channel.
    
    See also
    libp2p#2780 (comment)
    mxinden committed Aug 17, 2022
    Copy the full SHA
    53d16fd View commit details
    Browse the repository at this point in the history
  2. clippy.toml: Fix import

    mxinden committed Aug 17, 2022
    Copy the full SHA
    208cafb View commit details
    Browse the repository at this point in the history
  3. clippy.toml: Test

    mxinden committed Aug 17, 2022
    Copy the full SHA
    ac3535e View commit details
    Browse the repository at this point in the history
  4. Revert "clippy.toml: Test"

    This reverts commit ac3535e.
    mxinden committed Aug 17, 2022
    Copy the full SHA
    11fb7f1 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2022

  1. Copy the full SHA
    bf5fac1 View commit details
    Browse the repository at this point in the history