liburing icon indicating copy to clipboard operation
liburing copied to clipboard

About the issue with using IORING_OP_LINK_TIMEOUT

Open yxfangcs opened this issue 5 months ago • 0 comments

I'm writing a timeout read method using io_uring_prep_read + io_uring_prep_link_timeout, and the method is now functional. However, there's an issue:

The read CQE->res sometimes returns -ECANCELED due to the timeout, and I treat this as "no data was read." But in reality, this leads to data loss. I suspect that it might have already read some data, but the actual number of bytes read is replaced by -ECANCELED.

If this is the case, how can I solve this problem? Or, even if the operation is canceled, is there a way to still retrieve the number of bytes that were already read?

yxfangcs avatar Jun 19 '25 10:06 yxfangcs