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.
This commit is contained in:
Sean Chittenden 2016-03-25 13:58:50 -07:00
parent 58246fcc0b
commit a71fbe57e3
2 changed files with 1 additions and 2 deletions

View File

@ -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
}

View File

@ -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