Skip to content

Why is TcpStream::connect no longer using mio::net::TcpStream::connect? #678

Closed
@twittner

Description

@twittner
Contributor

In d25dae5, the implementation of TcpStream::connect was switched from using mio's non-blocking connect to the blocking std::net::TcpStream::connect which is performed in a background thread created by spawn_blocking. May I ask why you decided to no longer use mio's non-blocking connect? It seems the background thread spawned is unaware of any future cancellation, e.g. due to timeouts, but continues to run until all SYN retries have been exhausted which may easily last a couple of minutes. This in turn can cause a high number of threads to be created in the background.

Activity

ghost

ghost commented on Jan 21, 2020

@ghost

Hmmm, that definitely looks like an oversight during the refactor. I agree with you - we should use mio's non-blocking connect. Happy to review a PR for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @twittner

        Issue actions

          Why is TcpStream::connect no longer using mio::net::TcpStream::connect? · Issue #678 · async-rs/async-std