corebgp
corebgp copied to clipboard
dedicated sender thread for keepalive
My original issue what that I was seeing some BGP session close because of hold-timer expired on the remote end. This was due to the fact that I was consuming the updates rather slowly, and the combine select for received/send was getting somewhat stuck on receiving and could not send the keepalive in time.
Here I propose adding a dedicated goroutine to send the keepalive. I think this is OK, because even if we consume the updates slowly, it shouldn't prevent us from maintaining the BGP session, the sender can still detect we are falling behind using the TCP ACKs.
There may be better implementation that what I propose here.