Skip to content
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

Fix EAGAIN bug in ZMQ-RPC/ZMQ-PUB #9052

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

vtnerd
Copy link
Contributor

@vtnerd vtnerd commented Nov 4, 2023

A user reported over IRC that connecting to the ZMQ-RPC server via web browser would crash the ZMQ-RPC permanently, until restart. After investigation, I found out that this only happens when the ZMQ-PUB server is also enabled.

When ZMQ-PUB is enabled, the ZMQ server switches to zmq_poll instead of using a blocking read with zmq_read. Invalid messages are not handled by the zmq_poll, and instead are left to zmq_read to filter out. So a "spurious" wakeup is done for zmq_poll only to be given an EAGAIN error by zmq_read.

This should finally clear out the longstanding issue from #8199 - now that I know whats happening, I think this is the only fix. #8592 is being closed too.

@vtnerd vtnerd mentioned this pull request Nov 4, 2023
@vtnerd
Copy link
Contributor Author

vtnerd commented Nov 4, 2023

@Gingeropolous @SChernykh @trasherdk @sethforprivacy pinging people that were tracking the old issue.

@hinto-janai
Copy link
Contributor

From #8199:

Hopefully the next loop iteration the poll code doesn't return that data is available, because that would turn this into a busy spin loop

Is this unlikely enough to ignore?

@vtnerd
Copy link
Contributor Author

vtnerd commented Dec 13, 2023

It doesn't appear to happen, otherwise we would file a bug with upstream ZMQ.

@luigi1111 luigi1111 merged commit 9d7b253 into monero-project:master Jan 18, 2024
18 checks passed
@vtnerd vtnerd deleted the feature/zmq_rpc_eagain branch July 28, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants