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

recv may wait indefinitely in a SUB socket #159

Open
poyea opened this issue Jun 23, 2022 · 1 comment
Open

recv may wait indefinitely in a SUB socket #159

poyea opened this issue Jun 23, 2022 · 1 comment

Comments

@poyea
Copy link
Collaborator

poyea commented Jun 23, 2022

The issue is initially discussed on Discord. This issue is for future tracking and notes. This may be a bug or it may not.

The issue can be reproduced by removing async_helpers::sleep in examples/stock_server.rs. Then, start the examples and the client will wait for data. Only the first 128 frames are received on the client.

However, if we change that to wait for even 1ns, the client will receive data properly. After an initial search, I found that Poll::Pending is somehow polled from the ready_queue and hence it is being propagated.

@poyea poyea changed the title recv wait indefinitely in the stock example that uses a SUB socket recv may wait indefinitely in a SUB socket Jun 23, 2022
@Alexei-Kornienko
Copy link
Collaborator

Hi. Not sure that your description is actually related to the problem. async_helpers::sleep is needed just to simulate some kind of logical delay in producing messages. Without it PUB socket will simply spam as many messages as it can (and it can do a lot..). According to ZMQ spec PUB socket never blocks and simply discards messages that it cannot deliver. So in result it would simply throw away messages that don't fit in network buffer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants