From 166e44bf8005123e35b0f56001da7f0c3825220d Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 23 Dec 2024 22:56:56 +0530 Subject: [PATCH] fix: warp concurrent crash on PUT (#354) A regression caused by #349 --- pkg/bench/put.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/bench/put.go b/pkg/bench/put.go index b3e1659..6de1492 100644 --- a/pkg/bench/put.go +++ b/pkg/bench/put.go @@ -70,7 +70,18 @@ func (u *Put) Start(ctx context.Context, wait chan struct{}) (Operations, error) go func(i int) { rcv := c.Receiver() defer wg.Done() + + // Copy usermetadata and usertags per concurrent thread. opts := u.PutOpts + opts.UserMetadata = make(map[string]string, len(u.PutOpts.UserMetadata)) + opts.UserTags = make(map[string]string, len(u.PutOpts.UserTags)) + for k, v := range u.PutOpts.UserMetadata { + opts.UserMetadata[k] = v + } + for k, v := range u.PutOpts.UserTags { + opts.UserTags[k] = v + } + done := ctx.Done() <-wait