You've already forked opentelemetry-go
							
							
				mirror of
				https://github.com/open-telemetry/opentelemetry-go.git
				synced 2025-10-31 00:07:40 +02:00 
			
		
		
		
	Call Gosched if load an unmapped record (#469)
Signed-off-by: Bogdan Cristian Drutu <bogdandrutu@gmail.com>
This commit is contained in:
		| @@ -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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user