Test_HW1_Messaging_Broadcast_No_Ack

Test_HW1_Messaging_Broadcast_No_Ack

by Dávid Márk Valaczkai -
Number of replies: 3

// Given the following topology
// A -> B
// -> C
// If A sends a rumor to B, and B doesn't send back an ack, then A should send a
// rumor to C after the timeout. Here we use a timeout of 0, so the message
// should only be sent to one of the node.
I'm confused by this description. In task 5 we implement a mechanism that keeps attempting to send the rumor to a random neighbour until we receive and ACK from someone.
This seems to agree with the first sentence of the description. So A will send a rumor to B, receive no ACK, and then send the rumor to C.

I don't understand the second sentence. If the timeout is 0, why should we only send the message to one node? This seems illogical. 
If we skip sending to B because the timeout is 0, shouldn't we also skip sending to C?

In reply to Dávid Márk Valaczkai

Re: Test_HW1_Messaging_Broadcast_No_Ack

by Yuchen Qian -
Ack timeout equals to 0 means the node will wait on the ack forever.

The first sentence essentially describes the case where the ack timeout does
not equal to zero (described in task 5): after the timeout occurs on node A,
it will attempt to send the rumor message to another random neighbour.

The second sentence describes the scenario of the test case: A has a timeout
of value 0 so A never times out. After A sends a rumor message to either B or
C, A waits forever until it receives an ack from either B or C. Since B and C
also do not sending back any messages, only one of the node should receive
the rumor.

Hope this answers your question :)
In reply to Yuchen Qian

Re: Test_HW1_Messaging_Broadcast_No_Ack

by Emilien Baptiste Baty -
But if node A waits forever and node B and C doesn't send any messages, then I don't understand how the test is supposed to pass because it will never end. Even if I know that some students managed to pass this test, I don't understand how is that possible
In reply to Emilien Baptiste Baty

Re: Test_HW1_Messaging_Broadcast_No_Ack

by Tianxiao Shen -
I had the same question as you. I think it implies that Broadcast() should return and start another goroutine to wait for ack...