ringbahn / iou

Rust interface to io_uring
Apache License 2.0
328 stars 22 forks source link

Bug in submit_sqes_and_wait_with_timeout #33

Closed twissel closed 4 years ago

twissel commented 4 years ago

This test fails with assertion failed: cqe.is_timeout()

use std::io;
use std::time::Duration;

#[test]
fn test_timeout() -> io::Result<()> {
    let mut r = iou::IoUring::new(8)?;
    let num_submitted = r.submit_sqes_and_wait_with_timeout(1, Duration::from_millis(1))?;
    assert_eq!(num_submitted, 1);
    let cqe = r.peek_for_cqe().unwrap();
    assert!(cqe.is_timeout());
    Ok(())
}

If i'm not wrong, you forgot to set user_data to LIBURING_UDATA_TIMEOUT in submit_sqes_and_wait_with_timeout

withoutboats commented 4 years ago

You're completely right! This got messed up in the shuffle around timeouts.

Also, sorry for not reviewing/merging your other contributions yet. TL;DR: I no longer have the Linux laptop I had been using for developing iou & a repair shop is taking forever to fix the screen of my other Linux laptop I will be using in the future.

twissel commented 4 years ago

No worries :)

twissel commented 4 years ago

@withoutboats I'm sorry for asking a stupid question, but do you have a interest to support iou?

withoutboats commented 4 years ago

@twissel For the near term yes, I want to support iou until its in a mostly stable state. But in the longer term I'm interested in handing off most of the maintenance to other people.

This last month I've been unable to work on it just because I didn't have a machine with Linux handy. My hope is that over the next month or two we can get iou to a point of stability & just updating as liburing gets new features without making other changes.

withoutboats commented 4 years ago

Closed by #34