-
I use IORING_OP_POLL_ADD method to subsribe to I noticed that sometimes I get a completion event even after I call |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You always get a completion for a canceled request, for both the cancelation request and the targeted request. That isn't new, it's always been like that. If the event to cancel is racing with the completion, you may get a valid return. You should get -EALREADY for the POLL_REMOVE in this case, and normal completion for the POLL_ADD. Maybe I'm missing what you are really describing, so can you describe it in a bit more detail? Both in terms of expectations, but also in terms of what you're seeing that differs from that. |
Beta Was this translation helpful? Give feedback.
-
My code looks like this: poll_id = socket->AddPollEvent(POLLERR | POLLHUP, my_callback); // calls POLL_ADD underneath
IoLoop(socket); // ... read/write socket processing here ...* /
int result = socket->CancelPoll(poll_id); // calls POLL_REMOVE, and waits for the completion of cancellation request. returns the result.
printf("result %d\n", result); And what I see is:
My expectation is that (Additional info: I have not encountered this problem before. I suspect it happens if I call |
Beta Was this translation helpful? Give feedback.
You always get a completion for a canceled request, for both the cancelation request and the targeted request. That isn't new, it's always been like that. If the event to cancel is racing with the completion, you may get a valid return. You should get -EALREADY for the POLL_REMOVE in this case, and normal completion for the POLL_ADD.
Maybe I'm missing what you are really describing, so can you describe it in a bit more detail? Both in terms of expectations, but also in terms of what you're seeing that differs from that.