mirror of https://github.com/status-im/consul.git
proxycfg-sources: fix hot loop when service not found in catalog
Fixes a bug where a service getting deleted from the catalog would cause the ConfigSource to spin in a hot loop attempting to look up the service. This is because we were returning a nil WatchSet which would always unblock the select. Kudos to @freddygv for discovering this!
This commit is contained in:
parent
42996411cc
commit
6452118c15
|
@ -125,7 +125,7 @@ func (m *ConfigSource) startSync(closeCh <-chan chan struct{}, proxyID proxycfg.
|
|||
case ns == nil:
|
||||
m.Manager.Deregister(proxyID, source)
|
||||
logger.Trace("service does not exist in catalog, de-registering it with proxycfg manager")
|
||||
return nil, err
|
||||
return ws, nil
|
||||
case !ns.Kind.IsProxy():
|
||||
err := errors.New("service must be a sidecar proxy or gateway")
|
||||
logger.Error(err.Error())
|
||||
|
|
Loading…
Reference in New Issue