mirror of
https://github.com/status-im/consul.git
synced 2025-02-10 04:45:05 +00:00
Handle the case where there are no healthy servers
Pointed out by: @slackpad
This commit is contained in:
parent
d4ca349e21
commit
b1e392405c
@ -350,6 +350,11 @@ func (c *Client) RPC(method string, args interface{}, reply interface{}) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if server == nil {
|
||||||
|
c.logger.Printf("[ERR] consul: No healthy servers found in the server config")
|
||||||
|
return structs.ErrNoServers
|
||||||
|
}
|
||||||
|
|
||||||
// Forward to remote Consul
|
// Forward to remote Consul
|
||||||
if err := c.connPool.RPC(c.config.Datacenter, server.Addr, server.Version, method, args, reply); err != nil {
|
if err := c.connPool.RPC(c.config.Datacenter, server.Addr, server.Version, method, args, reply); err != nil {
|
||||||
atomic.AddUint64(&server.Disabled, 1)
|
atomic.AddUint64(&server.Disabled, 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user