TestGossiper download parallel multiple

TestGossiper download parallel multiple

par Samuel Jean Michel Jacquier,
Nombre de réponses : 2
Hey everyone,

I have a strange bug since the begining of my tests, that I wanted to carry alone but it stays unresolved and I really don't understand what it means.

While the test for IndexShares passes, TestGossiper-Download-Parallel-Multiple has an issue for the file of peer B. The Chunk 0 is requested by A, B sends it to A without any issue (B Marshal the packet and send it via its UDP Port, like any other packet sent in the project). But when the packet arrives at A, I can't unmarshal it. It says :
unexpected end of JSON input
Did anyone experienced this error, and have a hint of how it can be resolved ? I know we should not ask for debugging here but since I can transfer large files locally, and as the test for IndexShare passes, I wonder if it is not a specificity of the test case that anyone can explain.

Thanks a lot !
En réponse à Samuel Jean Michel Jacquier

Re: TestGossiper download parallel multiple

par Kirill Nikitin,

Hi,

My guess is that the buffer that you initialize for reading from a UDP socket is too small (i.e., something like buf = make([]byte, X)). X has to be bigger than the default chunk size + other headers. Otherwise, your gossiper reads only a part of a data reply gossip packet and hence it ends up with an incorrect json encoding (since the end is missing).

Does it help?

Kirill