Skip to content

SQPOLL can not work in rio. #48

Description

@hidva

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...

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions