cjrh/aiomsg

Add a feature for staggered reconnection logic

cjrh opened this issue · 1 comments

cjrh commented

If a great many sockets are in play, let's say 10000 connect sockets and 1 bind socket, it is possible that a network interruption (or a slow server restart) causes a large number of messages buffered on the connect sockets and these will all try to be sent immediately after reconnection when the bind socket once again becomes available. It would be good to check whether backpressure works (but it might not, due to how messages are sent, i.e., in the sending code the messages immediately go into a queue), but, it is probably also a good idea to add a feature that allows a user-specified random delay between connection attempts. If this is spread over, say five or ten seconds (for each connect socket) that might be enough to allow all the connections to come back up without overwhelming the server all at once.

cjrh commented

Added in #20