solana
solana copied to clipboard
`test_recv_mmsg_multi_iter_timeout` fails sometimes
Problem
I found out that from time to time test_recv_mmsg_multi_iter_timeout
fails.
It happens because number of received packets is not equal to 32: https://github.com/solana-labs/solana/blob/master/streamer/src/nonblocking/recvmmsg.rs#L136
Depending on the semantics of function recv_mmsg
, this failure might be due to:
- mistake in test -- if by design we cannot guarantee that we received all the packets that we've sent when call
recv_mmsg
- mistake in the
recv_mmsg
implementation. As far as I understand there are 2 aspects: (i)readiness
might be false positive, (ii) it should be checked for each of the packets in the loop. This might be resolve by usingrecv_from
or by movingreadable
call inside the loop: see https://github.com/solana-labs/solana/pull/27916 - Or it might be platform-dependent (I've reproduced only on my mac so far)
Proposed Solution
https://github.com/solana-labs/solana/pull/27916