Unclear if this is an actual problem, or a bug in the test.
go test -benchmem -run=^$ -bench ^BenchmarkIterator$ github.com/wetware/casm/pkg/cluster
goos: darwin
goarch: amd64
pkg: github.com/wetware/casm/pkg/cluster
cpu: Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
BenchmarkIterator-8 fatal error: sync: unlock of unlocked mutex
goroutine 46 [running]:
sync.fatal({0x100cd7bda?, 0x0?})
/usr/local/go/src/runtime/panic.go:1031 +0x1e
sync.(*Mutex).unlockSlow(0xc00123f390, 0xffffffff)
/usr/local/go/src/sync/mutex.go:229 +0x3c
sync.(*Mutex).Unlock(...)
/usr/local/go/src/sync/mutex.go:223
capnproto.org/go/capnp/v3.resolveHook(0x100f19830?)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/capability.go:264 +0x5d
capnproto.org/go/capnp/v3.Client.State({0xc00132c038?})
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/capability.go:495 +0x85
github.com/wetware/casm/pkg/util/stream.promise.Failed({{0xc00132c038?}, 0xc001229dd0?})
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/util/stream/stream.go:138 +0x2a
github.com/wetware/casm/pkg/util/stream.(*Stream[...]).Call(0xc00013a0a0, {0x100f19830, 0xc0008bb140}, 0x4)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/util/stream/stream.go:63 +0x1a5
github.com/wetware/casm/pkg/cluster.iterator.func1({0x129e89fa8?, 0x1017fe840?})
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/cluster/server.go:125 +0x5c
github.com/wetware/casm/pkg/cluster.Server.bind({{0x100f104c0?, 0xc000290140?}}, 0xc000090120, 0xc000130018)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/cluster/server.go:102 +0xb1
github.com/wetware/casm/pkg/cluster.Server.Iter({{0x100f104c0?, 0xc000290140?}}, {0x100f19830, 0xc0008bb140}, {0xc00011cd80?})
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/cluster/server.go:55 +0x29c
github.com/wetware/casm/internal/api/routing.View_Methods.func2({0x100f19830?, 0xc0008bb140?}, 0xc0000b6240?)
/Users/lthibault/Go/src/github.com/wetware/casm/internal/api/routing/routing.capnp.go:306 +0x38
capnproto.org/go/capnp/v3/server.(*Server).handleCall(0x1000479d1?, {0x100f19830?, 0xc0008bb140?}, 0xc00011eb60)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:206 +0x97
capnproto.org/go/capnp/v3/server.(*Server).handleCalls.func2(0x100f19830?, 0xc0009200c0?, {0x100f19830?, 0xc0008bb140?}, 0x1?)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:182 +0x4a
capnproto.org/go/capnp/v3/server.(*Server).handleCalls(0xc00024a000, {0x100f19830?, 0xc000920080})
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:183 +0x145
created by capnproto.org/go/capnp/v3/server.New
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:122 +0x325
goroutine 1 [chan receive]:
testing.(*B).doBench(0xc000150240)
/usr/local/go/src/testing/benchmark.go:285 +0x7f
testing.(*benchContext).processBench(0xc000283470, 0x238?)
/usr/local/go/src/testing/benchmark.go:589 +0x3aa
testing.(*B).run(0xc000150240?)
/usr/local/go/src/testing/benchmark.go:276 +0x67
testing.(*B).Run(0xc000294900, {0x100c1aa42?, 0x63892750?}, 0x100dc6390)
/usr/local/go/src/testing/benchmark.go:677 +0x453
testing.runBenchmarks.func1(0xc000294900?)
/usr/local/go/src/testing/benchmark.go:550 +0x6e
testing.(*B).runN(0xc000294900, 0x1)
/usr/local/go/src/testing/benchmark.go:193 +0x102
testing.runBenchmarks({0x100cdd199, 0x23}, 0x101830480?, {0x10157de40, 0x1, 0x40?})
/usr/local/go/src/testing/benchmark.go:559 +0x418
testing.(*M).Run(0xc0002b59a0)
/usr/local/go/src/testing/testing.go:1733 +0x811
main.main()
_testmain.go:63 +0x1aa
goroutine 39 [runnable]:
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc0035400c0?, {{0xc003523a20?, 0x4?, 0x4?}, 0x20?}, {0x100f10220?, 0xc0008ced00?})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:232 +0x385
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc003521500, {{0xc003523a20?, 0x0?, 0x4?}, 0xc003522d30?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc00089c2a0, {{0xc003523a20?, 0x100054812?, 0x10?}, 0xc0000c1180?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc0000d0000, {{0xc003523a20?, 0x0?, 0x4?}, 0xc0000c0e90?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc00027bda0, {{0xc003523a20?, 0x0?, 0x4?}, 0xc0000c1d80?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc000123920, {{0xc003523a20?, 0x0?, 0x4?}, 0xc000040ac0?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc0002a1260, {{0xc003523a20?, 0x0?, 0x4?}, 0xc00090a9a0?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc0002a05a0, {{0xc003523a20?, 0x0?, 0x4?}, 0xc000257c20?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc000267c20, {{0xc003523a20?, 0x0?, 0x1299fffff?}, 0xc0002579c0?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc000912a80, {{0xc003523a20?, 0x129800f00?, 0x0?}, 0xc000125480?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc000266900, {{0xc003523a20?, 0x10001aa4b?, 0x1299fffff?}, 0xc000256ce0?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc0000bf2c0, {{0xc003523a20?, 0x0?, 0x1299fffff?}, 0xc0000c0420?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc000266300, {{0xc003523a20?, 0x129b85670?, 0x2?}, 0xc0002568e0?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).insert(0xc000123da0, {{0xc003523a20?, 0x10?, 0xc0035239e0?}, 0x10?}, {0x100f10220?, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:264 +0x25b
github.com/libp2p/go-cidranger.(*prefixTrie).Insert(0xc000123da0, {0x100f10220, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/trie.go:95 +0xdb
github.com/libp2p/go-cidranger.(*versionedRanger).Insert(0x100bdc4f7?, {0x100f10220, 0xc0008ced00})
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/version.go:29 +0xd4
github.com/libp2p/go-libp2p-asn-util.newAsnStore()
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/asn.go:61 +0x163
github.com/libp2p/go-libp2p-asn-util.newIndirectAsnStore.func1()
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/asn.go:89 +0x65
created by github.com/libp2p/go-libp2p-asn-util.newIndirectAsnStore
/Users/lthibault/Go/pkg/mod/github.com/libp2p/[email protected]/asn.go:87 +0x9b
goroutine 40 [select]:
github.com/ipfs/go-log/writer.(*MirrorWriter).logRoutine(0xc000287a40)
/Users/lthibault/Go/pkg/mod/github.com/ipfs/[email protected]/writer/writer.go:71 +0x11f
created by github.com/ipfs/go-log/writer.NewMirrorWriter
/Users/lthibault/Go/pkg/mod/github.com/ipfs/[email protected]/writer/writer.go:36 +0xca
goroutine 24 [chan receive]:
github.com/wetware/casm/pkg/cluster.handler.Next(...)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/cluster/client.go:98
github.com/wetware/casm/pkg/cluster.Iterator.Next(...)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/cluster/client.go:77
github.com/wetware/casm/pkg/cluster_test.BenchmarkIterator(0xc000150240)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/cluster/view_test.go:211 +0x5b5
testing.(*B).runN(0xc000150240, 0x2710)
/usr/local/go/src/testing/benchmark.go:193 +0x102
testing.(*B).launch(0xc000150240)
/usr/local/go/src/testing/benchmark.go:334 +0x1c5
created by testing.(*B).doBench
/usr/local/go/src/testing/benchmark.go:284 +0x6c
goroutine 52 [semacquire]:
sync.runtime_SemacquireMutex(0x0?, 0x0?, 0x1008ea762?)
/usr/local/go/src/runtime/sema.go:77 +0x25
sync.(*Mutex).lockSlow(0xc00013a0a8)
/usr/local/go/src/sync/mutex.go:171 +0x165
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:90
github.com/wetware/casm/pkg/util/stream.(*Stream[...]).next(0xc00013a0a0?)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/util/stream/stream.go:95 +0x5a
github.com/wetware/casm/pkg/util/stream.(*Stream[...]).loop(0xc00013a0a0)
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/util/stream/stream.go:88 +0xdb
created by github.com/wetware/casm/pkg/util/stream.(*Stream[...]).Call
/Users/lthibault/Go/src/github.com/wetware/casm/pkg/util/stream/stream.go:53 +0x179
goroutine 51 [select]:
capnproto.org/go/capnp/v3/server.(*Server).handleCalls.func1()
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:175 +0xb3
created by capnproto.org/go/capnp/v3/server.(*Server).handleCalls
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:173 +0x125
goroutine 47 [chan receive]:
capnproto.org/go/capnp/v3.(*ClientPromise).shutdown(...)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/capability.go:685
capnproto.org/go/capnp/v3.(*Promise).Resolve(0x0?, {0x0, 0x0, 0x0, {0x0, 0x0}, 0x0, 0x0}, {0x0, 0x0})
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/answer.go:190 +0x145
capnproto.org/go/capnp/v3.(*Promise).Fulfill(...)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/answer.go:130
capnproto.org/go/capnp/v3/server.(*structReturner).Return(0xc00123f310, {0x0?, 0x0})
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/answer.go:240 +0x2e5
capnproto.org/go/capnp/v3/server.(*Server).handleCall(0x1000479d1?, {0x100f19830?, 0xc002c42940?}, 0xc001321ee0)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:214 +0x14f
capnproto.org/go/capnp/v3/server.(*Server).handleCalls.func2(0x100f19830?, 0xc0008bb140?, {0x100f19830?, 0xc002c42940?}, 0x1?)
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:182 +0x4a
capnproto.org/go/capnp/v3/server.(*Server).handleCalls(0xc00024a070, {0x100f19830?, 0xc000920140})
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:183 +0x145
created by capnproto.org/go/capnp/v3/server.New
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:122 +0x325
goroutine 1693 [select]:
capnproto.org/go/capnp/v3/server.(*Server).handleCalls.func1()
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:175 +0xb3
created by capnproto.org/go/capnp/v3/server.(*Server).handleCalls
/Users/lthibault/Go/pkg/mod/capnproto.org/go/capnp/[email protected]/server/server.go:173 +0x125
exit status 2
FAIL github.com/wetware/casm/pkg/cluster 0.322s
FAIL