opamp-go icon indicating copy to clipboard operation
opamp-go copied to clipboard

Add Close() to types.Connection to allow the server to close a connection

Open andykellr opened this issue 2 years ago • 0 comments

It can be useful to close an agent connection to the server and I propose that a Close() method be added to the types.Connection interface.

The agent may quickly reconnect, but in a server cluster with multiple nodes, periodically closing connections can help with rebalancing the cluster.

Consider the case of 100 agents connected to a 2-node cluster and assume a load balancer splits them 50/50 between the 2 nodes. If one node is terminated, 50 agents will reconnect and now all 100 agents will be connected to a single node. If a node is added, there will still be 100 agents connected to a single node and the new node will have 0 agents.

andykellr avatar Jun 09 '22 01:06 andykellr