Closed Degoah closed 1 week ago
If you don't set sqe->user_data, then it'll contain whatever was in it before. Could this perhaps be your issue? Remember that it's a ring, and your size is 8, so whenever you roll around and get an sqe that you've used before (eg the 9th), then if you don't set user_data in the sqe, it'll be set to whatever the last user set it to.
Thx. U r absolutely right! Cheers!
Closing this one up, I'll add a note to the man pages.
Description:
While sending UDP data to the server via a Python script, the POLLIN event on the eventfd file descriptor gets triggered unexpectedly. This is problematic because the eventfd is designed to be triggered only by a write operation performed by the signal handler (e.g., upon receiving a SIGINT or another signal), which should cause the completion event to be generated. However, no write operation is performed on the eventfd, yet the POLLIN event gets triggered when receiving UDP data.
Steps to Reproduce:
python udp_sender.py 10 512
Expected Behavior:
The POLLIN event on the eventfd should only be triggered when a signal handler writes to it, such as during a SIGINT (Ctrl+C) event. It should not be triggered merely by receiving UDP data via the recvmsg operation in io_uring.
Relevant Code:
Questions:
Workaround: Setting user_data on the recvmsg-specific SQE request prevents the issue. However, this behavior is unexpected, and it isn't clear why omitting user_data for the recmsg-related sqe request causes the issue to arise.
Server Application Code Overview:
Python Script for Reproducing the Issue:
Environment: