mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Make ReqInfo concurrency safe (#15204)
Some read/writes of ReqInfo did not get appropriate locks, leading to races. Make sure reading and writing holds appropriate locks.
This commit is contained in:
@@ -792,6 +792,8 @@ func likelyUnescapeGeneric(p string, escapeFn func(string) (string, error)) stri
|
||||
func updateReqContext(ctx context.Context, objects ...ObjectV) context.Context {
|
||||
req := logger.GetReqInfo(ctx)
|
||||
if req != nil {
|
||||
req.Lock()
|
||||
defer req.Unlock()
|
||||
req.Objects = make([]logger.ObjectVersion, 0, len(objects))
|
||||
for _, ov := range objects {
|
||||
req.Objects = append(req.Objects, logger.ObjectVersion{
|
||||
|
||||
Reference in New Issue
Block a user