mirror of https://github.com/minio/minio.git
fix: replace context by timeout-context from parent-context when `selfSpeedTest` (#17906)
This commit is contained in:
parent
124e28578c
commit
6aeca54ece
|
@ -85,14 +85,9 @@ func selfSpeedTest(ctx context.Context, opts speedTestOpts) (SpeedTestResult, er
|
|||
|
||||
objCountPerThread := make([]uint64, opts.concurrency)
|
||||
|
||||
uploadsCtx, uploadsCancel := context.WithCancel(context.Background())
|
||||
uploadsCtx, uploadsCancel := context.WithTimeout(ctx, opts.duration)
|
||||
defer uploadsCancel()
|
||||
|
||||
go func() {
|
||||
time.Sleep(opts.duration)
|
||||
uploadsCancel()
|
||||
}()
|
||||
|
||||
objNamePrefix := pathJoin(speedTest, mustGetUUID())
|
||||
|
||||
userMetadata := make(map[string]string)
|
||||
|
@ -144,12 +139,8 @@ func selfSpeedTest(ctx context.Context, opts speedTestOpts) (SpeedTestResult, er
|
|||
}, nil
|
||||
}
|
||||
|
||||
downloadsCtx, downloadsCancel := context.WithCancel(context.Background())
|
||||
downloadsCtx, downloadsCancel := context.WithTimeout(ctx, opts.duration)
|
||||
defer downloadsCancel()
|
||||
go func() {
|
||||
time.Sleep(opts.duration)
|
||||
downloadsCancel()
|
||||
}()
|
||||
|
||||
gopts := minio.GetObjectOptions{}
|
||||
gopts.Set(globalObjectPerfUserMetadata, "true") // Bypass S3 API freeze
|
||||
|
|
Loading…
Reference in New Issue