-
On a single io_uring, I'm in the process of testing cancel I/O but keep getting errno 2 ( In my test, I did a read request first from a client to a server, since the server is not writing anything I will get an errno 11 (
Then I issued a cancel request of the above read request as below before submitting the request:
I used the The corresponding SQE and CQE for the cancel request are shown below:
Also, I had Why would the result of the cancel request be not found |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
If I'm reading this right, you issue a request, and that completes with -11 as cqe->res. That means the request is no longer active, it has completed. So your cancelation will return -ENOENT, as no such request exists (it already completed). |
Beta Was this translation helpful? Give feedback.
-
It only makes sense to attempt cancelation of a request that is still in progress. Since the read you're trying to cancel already completed, not quite sure what you expect the cancelation request to do? The request is already completed and gone. |
Beta Was this translation helpful? Give feedback.
-
This has nothing to do with io_uring_wait_cqe(). If it fails with -11, then it has already completed before you even call io_uring_wait_cqe(). As a general comment, you really should move to a newer base. 5.5 is really ancient, particularly in io_uring terms. |
Beta Was this translation helpful? Give feedback.
-
I'm guessing your socket is marked nonblock, just use a blocking socket? |
Beta Was this translation helpful? Give feedback.
-
Those sound like expected results - you get -EALREADY since it was already in progress, and the original request errors with -EINTR because it was interrupted.
Well, you're the one that picked user_data for the cancelation request, so just pick a different value? |
Beta Was this translation helpful? Give feedback.
Those sound like expected results - you get -EALREADY since it was already in progress, and the original request errors with -EINTR because it was interrupted.
Well, you're the one that picked user_data for the cancelation request, so just pick a different value?