enhance: Use RLock for ListPrivilegeGroups (#43998)

Related to #43901

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2025-08-21 23:45:46 +08:00 committed by GitHub
parent ec6681b018
commit 847b79e197
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1673,8 +1673,8 @@ func (mt *MetaTable) DropPrivilegeGroup(ctx context.Context, groupName string) e
}
func (mt *MetaTable) ListPrivilegeGroups(ctx context.Context) ([]*milvuspb.PrivilegeGroupInfo, error) {
mt.permissionLock.Lock()
defer mt.permissionLock.Unlock()
mt.permissionLock.RLock()
defer mt.permissionLock.RUnlock()
return mt.catalog.ListPrivilegeGroups(ctx)
}