raiden-network / raiden

Raiden Network
https://developer.raiden.network
Other
1.84k stars 376 forks source link

Message retry improvements. #5607

Open hackaugusto opened 4 years ago

hackaugusto commented 4 years ago

Abstract

hackaugusto commented 4 years ago

~As an additional side note: Since Matrix is a chat room, the messages do persist for some time, retrying is totally necessary under most circumstances, with the exception of when an operator clear the messages to free up space. Therefore the retry timeout can be significantly large. Ideally we would be able to detect if a message was removed from the room, and only retry then.~

Edit: I forgot one scenario, retries are necessary to fix race conditions against the blockchain, so the retry interval cannot be large, it has to be around the expect time it takes for a block to propagate through the network.

ulope commented 4 years ago

Regarding your last point, there is #4110 which is somewhat related.

andrevmatos commented 4 years ago

About 2nd, the reason it was done like that is performance: having a per-message generator allows us to batch all messages that need to be sent in the same time window (I think rn the loop is ~5s). Specially on bursts of messages to the same room, this can save us several requests. Just a headsup though, go ahead if you think it's not worth it.

hackaugusto commented 4 years ago

@andrevmatos did you measure the performance impact? Do you have a reference to the results?

andrevmatos commented 4 years ago

No, we didn't, but everytime you see N messages batched together, you can assume the http roundtrip time for sending these messages was cut ~N times