When I optimized prometheus, I removed duplicate string labels from the sequence.
When I concurrently called the unique
package of go1.23, the insertion caused a panic:
panic: internal/concurrent.HashMapTrie: ran out of hash bits while inserting
goroutine 507 [running]:
internal/concurrent.(*HashTrieMap[...]).expand(0x16329c0?, 0xc01401ea80, 0xc017143bc0, 0x774483fcd3cff19b, 0x0, 0xc000cf3680)
/root/tools/go1.23.1/src/internal/concurrent/hashtriemap.go:163 +0x1ea
internal/concurrent.(*HashTrieMap[...]).LoadOrStore(0x16329c0, {0xc0128e914c, 0x8}, {0x7f27a21a2f18})
/root/tools/go1.23.1/src/internal/concurrent/hashtriemap.go:142 +0x3c8
unique.Make[...]({0xc0128e914c, 0x8})
/root/tools/go1.23.1/src/unique/handle.go:67 +0x1ea
github.com/baudtime/baudtime/datanode/tsdb.(*Head).getOrCreate(0xc000368d80, 0x17fc4e1ec5dcc73d, {0xc0165e7ea0, 0x6, 0x7})
/root/go_source/src/github.com/baudtime/baudtime/datanode/tsdb/head.go:1768 +0x1ee
Does unique
not provide concurrent calls?
Multiple goroutine concurrent access, do I have to add a lock?
New contributor
user27362697 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1