fix: avoid audit log race protection deadlocks (#17168)

This commit is contained in:
Klaus Post
2023-05-09 08:11:32 -07:00
committed by GitHub
parent a7f266c907
commit 99c4ffa34f
2 changed files with 9 additions and 4 deletions

View File

@@ -278,9 +278,9 @@ func errToEntry(ctx context.Context, err error, errKind ...interface{}) log.Entr
API = req.API
}
kv := req.GetTags()
tags := make(map[string]interface{}, len(kv))
for _, entry := range kv {
// Copy tags. We hold read lock already.
tags := make(map[string]interface{}, len(req.tags))
for _, entry := range req.tags {
tags[entry.Key] = entry.Val
}