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
56144cf5f7
commit
8da6710958
|
@ -125,7 +125,7 @@ func (m *ConfigSource) startSync(closeCh <-chan chan struct{}, proxyID proxycfg.
|
||||||
case ns == nil:
|
case ns == nil:
|
||||||
m.Manager.Deregister(proxyID, source)
|
m.Manager.Deregister(proxyID, source)
|
||||||
logger.Trace("service does not exist in catalog, de-registering it with proxycfg manager")
|
logger.Trace("service does not exist in catalog, de-registering it with proxycfg manager")
|
||||||
return nil, err
|
return ws, nil
|
||||||
case !ns.Kind.IsProxy():
|
case !ns.Kind.IsProxy():
|
||||||
err := errors.New("service must be a sidecar proxy or gateway")
|
err := errors.New("service must be a sidecar proxy or gateway")
|
||||||
logger.Error(err.Error())
|
logger.Error(err.Error())
|
||||||
|
|
Loading…
Reference in New Issue