Skip to content

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

Closed
@twittner

Description

@twittner

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.

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