spacejam / rio

pure rust io_uring library, built on libc, thread & async friendly, misuse resistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQPOLL can not work in rio.

hidva opened this issue · comments

I am currently transforming KuiBaDB into a fully asynchronous database, and want to use RIO as the underlying implementation of asynchronous IO.

But it seems that IORING_SETUP_SQPOLL can not work in RIO. RIO should also update Sq::ktail when IORING_SETUP_SQPOLL is enabled, but it doesn't. This causes the kernel to always think that there is no new SQE, which causes the Completion::wait() block forever.

fn main() {
    let mut cfg = rio::Config::default();
    cfg.sq_poll = true;
    let ring = cfg.start().expect("create uring");
    let file = std::fs::File::open("file").expect("openat");
    let data: &mut [u8] = &mut [0; 66];
    let completion = ring.read_at(&file, &data, 0);

    // if using threads
    completion.wait().unwrap();
}
[zhanyi@X rustplay]# /home/zhanyi/project/org/hidva.com/rustplay/target/debug/rustplay
^C  # block forever...