1
0
mirror of https://github.com/minio/minio synced 2024-07-05 17:08:43 +00:00

fix: delete globalProfiler should lock (#16697)

This commit is contained in:
jiuker 2023-02-25 10:37:44 +08:00 committed by GitHub
parent e05f3d5d84
commit 6e8960ccdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -803,6 +803,8 @@ func (a adminAPIHandlers) ProfileHandler(w http.ResponseWriter, r *http.Request)
for {
select {
case <-ctx.Done():
globalProfilerMu.Lock()
defer globalProfilerMu.Unlock()
for k, v := range globalProfiler {
v.Stop()
delete(globalProfiler, k)