mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-04 09:43:23 +02:00
Call Gosched if load an unmapped record (#469)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
This commit is contained in:
parent
69df67d449
commit
2584c3e7c4
@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"sort"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -179,6 +180,9 @@ func (i *instrument) acquireHandle(ls *labels) *record {
|
||||
// one time only usages, OR we can make this a blocking path and use
|
||||
// a Mutex that protects the delete operation (delete only if the old
|
||||
// record is associated with the key).
|
||||
|
||||
// Let collector get work done to remove the entry from the map.
|
||||
runtime.Gosched()
|
||||
continue
|
||||
}
|
||||
// The new entry was added to the map, good to go.
|
||||
|
Loading…
Reference in New Issue
Block a user