Skip to content

Async::<UnixStream>::connect returning with io::ErrorKind::WouldBlock #18

@JayceFayne

Description

@JayceFayne

I am in the process of moving swayipc from async-std to async-io. While running the unit tests I encountered tests failing with io::ErrorKind::WouldBlock. After re-running the current tests with the latest version of async-std I encountered the same behaviour (since async-std moved to async-io). The unit tests run without failing on async-std version 1.5 since this is the last version using mio-uds. I extracted an example on how to reproduce this bug:

use async_io::Async;
use futures_lite::future;
use std::os::unix::net::UnixStream;
use std::thread;

fn main() {
    let mut handles = Vec::new();
    for _ in 1..100 {
        let handle = thread::spawn(|| {
            future::block_on(async {
                Async::<UnixStream>::connect("pathtosomeunixsocket").await
            })
        });
        handles.push(handle);
    }
    for handle in handles {
        if let Err(error) = handle.join().unwrap() {
            dbg!(error);
        }
    }
}

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