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

If "get_next_classical" timeouts, successive calls won't read any messages #146

Open
SDABIS opened this issue Oct 18, 2022 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@SDABIS
Copy link

SDABIS commented Oct 18, 2022

Describe the bug
Hi.
I'm trying to implement a network in which one node is listening to multiple neighbors. My current implementation makes multiple calls to "get_next_classical", but I encountered a bug: if a call to "get_next_classical" timeouts without receiving a message, any successive call to "get_next_classical" will also timeout, regardless if any message has arrived.

To Reproduce
Steps to reproduce the behavior:

  1. Create a template code
  2. Protocol_1 performs sleep(3), and then host.send_classical(receiver, s, await_ack=True)
  3. Protocol_2 performs host.get_next_classical(sender, wait=2).
  4. Protocol_2 performs host.get_next_classical(sender)

Expected behavior
Step 3 should always timeout, since Protocol_1 sleeps for 3 seconds. The second call to "get_next_classical" should wait for 1 second, and then return the message when Protocol_1 sends it.

What I encountered is that this second call to "get_next_classical" never reads the incoming message.

@SDABIS SDABIS added the bug Something isn't working label Oct 18, 2022
@stephendiadamo
Copy link
Collaborator

The behaviour I would expect in this code is that the first call to get_next_classical times out after 2 seconds and the next call is made, which doesn't wait at all. What if you had put wait=2 in the second call? It could also be that the first message arrives between the first and second call. Does the second call return nothing? I'll test this myself in the coming days.

@SDABIS
Copy link
Author

SDABIS commented Oct 19, 2022

Thank you for looking into it.
Changing the second call to "wait=2" does not change anything: it also timeouts without reading the message. In both cases, the call returns "None".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants