From a71fbe57e31cadcc517df784b7d18856db568300 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Fri, 25 Mar 2016 13:58:50 -0700 Subject: [PATCH] Only log in FindServers In FindServer this is a useful warning hinting why its call failed. RPC returns error and leaves it to the higher level caller to do whatever it wants. As an operator, I'd have the detail necessary to know why the RPC call(s) failed. --- consul/client.go | 1 - consul/server_manager/server_manager.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/consul/client.go b/consul/client.go index 26db9fc51f..0b536a8d52 100644 --- a/consul/client.go +++ b/consul/client.go @@ -324,7 +324,6 @@ func (c *Client) localEvent(event serf.UserEvent) { func (c *Client) RPC(method string, args interface{}, reply interface{}) error { server := c.serverMgr.FindServer() if server == nil { - c.logger.Printf("[ERR] consul: No healthy servers found in the server config") return structs.ErrNoServers } diff --git a/consul/server_manager/server_manager.go b/consul/server_manager/server_manager.go index 5fec577e64..bb4d4fad1c 100644 --- a/consul/server_manager/server_manager.go +++ b/consul/server_manager/server_manager.go @@ -146,7 +146,7 @@ func (sm *ServerManager) FindServer() *server_details.ServerDetails { serverCfg := sm.getServerConfig() numServers := len(serverCfg.servers) if numServers == 0 { - sm.logger.Printf("[WARN] consul: No servers found in the server config") + sm.logger.Printf("[WARN] consul: No servers available") return nil } else { // Return whatever is at the front of the list because it is