Skip to content

Commit

Permalink
tweak the order of judgement
Browse files Browse the repository at this point in the history
  • Loading branch information
whalecold committed Mar 12, 2024
1 parent 76d6cee commit 7cf1733
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/manager/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (c *xdsClient) ndsWarmup() {
}

func (c *xdsClient) listenerWarmup() {
// watch the NameTable when init the xds client
// watch the Listener when init the xds client, it is used for inbound side.
c.Watch(xdsresource.ListenerType, reservedLdsResourceName, false)
<-c.inboundInitRequestCh
klog.Infof("KITEX: [XDS] lds, warmup done")
Expand Down Expand Up @@ -476,7 +476,7 @@ func (c *xdsClient) handleLDS(resp *discoveryv3.DiscoveryResponse) error {
c.resourceUpdater.UpdateResource(xdsresource.ListenerType, filteredRes, resp.GetVersionInfo())

if c.closedInboundInitCh.CompareAndSwap(false, true) {
klog.Info("[xds] receive inbound init request")
klog.Info("KITEX: [xds] receive inbound init request")
close(c.inboundInitRequestCh)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion core/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (m *xdsResourceManager) cleaner() {
continue
}
// should not delete the reserved resource
if time.Since(t) > defaultCacheExpireTime && !isReservedResource(rt, rName) {
if !isReservedResource(rt, rName) && time.Since(t) > defaultCacheExpireTime {
delete(m.meta[rt], rName)
if m.cache[rt] != nil {
delete(m.cache[rt], rName)
Expand Down

0 comments on commit 7cf1733

Please sign in to comment.