Commit 98254a34 authored by Erik Wilson's avatar Erik Wilson

Change load balancer logging to debug

parent 862c7ee3
...@@ -75,6 +75,7 @@ func Setup(ctx context.Context, cfg cmds.Agent) (_lb *LoadBalancer, _err error) ...@@ -75,6 +75,7 @@ func Setup(ctx context.Context, cfg cmds.Agent) (_lb *LoadBalancer, _err error)
lb.proxy.AddRoute(serviceName, &tcpproxy.DialProxy{ lb.proxy.AddRoute(serviceName, &tcpproxy.DialProxy{
Addr: serviceName, Addr: serviceName,
DialContext: lb.dialContext, DialContext: lb.dialContext,
OnDialError: onDialError,
}) })
if err := lb.updateConfig(); err != nil { if err := lb.updateConfig(); err != nil {
...@@ -118,14 +119,14 @@ func (lb *LoadBalancer) dialContext(ctx context.Context, network, address string ...@@ -118,14 +119,14 @@ func (lb *LoadBalancer) dialContext(ctx context.Context, network, address string
if err == nil { if err == nil {
return conn, nil return conn, nil
} }
logrus.Warnf("Dial error from load balancer: %s", err) logrus.Debugf("Dial error from load balancer: %s", err)
newServer, err := lb.nextServer(targetServer) newServer, err := lb.nextServer(targetServer)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if targetServer != newServer { if targetServer != newServer {
logrus.Warnf("Dial context in load balancer failed over to %s", newServer) logrus.Debugf("Dial server in load balancer failed over to %s", newServer)
} }
if ctx.Err() != nil { if ctx.Err() != nil {
return nil, ctx.Err() return nil, ctx.Err()
...@@ -140,3 +141,8 @@ func (lb *LoadBalancer) dialContext(ctx context.Context, network, address string ...@@ -140,3 +141,8 @@ func (lb *LoadBalancer) dialContext(ctx context.Context, network, address string
} }
} }
} }
func onDialError(src net.Conn, dstDialErr error) {
logrus.Debugf("Incoming conn %v, error dialing load balancer servers: %v", src.RemoteAddr().String(), dstDialErr)
src.Close()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment