Skip to content

Commit

Permalink
fix: Remove eviction operations out of lock (milvus-io#33834)
Browse files Browse the repository at this point in the history
See also milvus-io#33823

`EvictCacheValueByFormat` may be block by on going `CASCacheValue` and
cause possible deadlock

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia authored and yellow-shine committed Jul 2, 2024
1 parent 01a165f commit 851ab1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/config/etcd_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ func (es *EtcdSource) update(configs map[string]string) error {
return err
}
es.currentConfigs = configs
es.Unlock()
if es.manager != nil {
es.manager.EvictCacheValueByFormat(lo.Map(events, func(event *Event, _ int) string { return event.Key })...)
}
es.Unlock()

es.configRefresher.fireEvents(events...)
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/file_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ func (fs *FileSource) update(configs map[string]string) error {
return err
}
fs.configs = configs
fs.Unlock()
if fs.manager != nil {
fs.manager.EvictCacheValueByFormat(lo.Map(events, func(event *Event, _ int) string { return event.Key })...)
}
fs.Unlock()

fs.configRefresher.fireEvents(events...)
return nil
Expand Down

0 comments on commit 851ab1e

Please sign in to comment.