fix: [2.4] metaCache cleanup issue when listPolicy failed (#34697)

- issue:#34667
- pr: #34449

Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
SimFG 2024-07-16 14:13:45 +08:00 committed by GitHub
parent 66b5cbe27c
commit d607a43ea6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1108,6 +1108,12 @@ func (m *MetaCache) RefreshPolicyInfo(op typeutil.CacheOp) (err error) {
log.Error("fail to init meta cache", zap.Error(err))
return err
}
if !merr.Ok(resp.GetStatus()) {
log.Error("fail to init meta cache",
zap.String("error_code", resp.GetStatus().GetErrorCode().String()),
zap.String("reason", resp.GetStatus().GetReason()))
return merr.Error(resp.Status)
}
m.mu.Lock()
defer m.mu.Unlock()