-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug using SubmissionQueueEvent::prep_timeout #15
Comments
Looks like this was changed in liburing upstream in 3c9d9580. Interestingly I also see a $ git log --oneline|head -n1
5943354 test/connect: fixup a few style issues
$ test/timeout
test_single_timeout: Timeout: Bad file descriptor
test_single_timeout failed |
I saw when I updated the submodule in uring-sys that several of these prep APIs have started passing -1 for the fd, though I haven't investigated the impact of that. Someone should figure that out. But my guess as to the most likely reason this is failing for y'all even after the change is that your kernel doesn't actually support timeouts! I'm certain the one I've been testing against (5.2.11) doesn't. This feature was added to the io_uring interface since September, I'm not sure what version number is the first to have timeouts but its extremely recent. |
I'm sorry for jumping the gun, timeout support looks like it was included in 5.4, which was released... five days ago 😅. For the fd as -1, it seems like a conceptual change (-1 more invalid than 0) but without any material difference.
My impression is keeping the fd's 0 shouldn't break timeouts, nops, etc. (when they're supported). |
Cool! As to the fds, if we're currently setting any of them to |
While the commit message in liburing sounds like its more concerned with the developers testing the io_uring interface, my main concern would be having the most compatible outcome with old kernels that don't recognize the operation you're using. To that end we wouldn't want it to accidentally perform some other operation on a valid fd the program is using. It's sort of interesting that you got EBADFILE when you set the fd to I think we should set this to -1 like liburing does, to be most safe on systems that don't support the op. |
Another more holistic option is to pursue ringbahn/uring-sys#4 and expose all the |
Trying to submit a timeout, I obtain an invalid argument error:
In
iou
, the timeout file descriptor is set to 0.https://github.com/withoutboats/iou/blob/427273598e9ab7759a19b6301803eaba870dfc18/src/sqe.rs#L183
In
liburing
, it looks like the file descriptor is set to -1 based on:source
and
source
Changing the fd from 0 to -1 in
SubmissionQueueEvent::prep_timeout
, I then obtain a BADFILE error:Am I doing something silly here? Maybe there's something up with my kernel version (5.2.14)?
Thank you for your time.
The text was updated successfully, but these errors were encountered: