Skip to content

Instantly share code, notes, and snippets.

@s1na
Created April 24, 2018 13:20
Show Gist options
  • Save s1na/1afeac4bcaa578bd6d08df806f8b53f1 to your computer and use it in GitHub Desktop.
Save s1na/1afeac4bcaa578bd6d08df806f8b53f1 to your computer and use it in GitHub Desktop.
ipfs-cluster races happening during tests
==================
WARNING: DATA RACE
Read at 0x00c4204329f0 by goroutine 33:
github.com/ipfs/ipfs-cluster/consensus/raft.(*Consensus).finishBootstrap()
/go/src/github.com/ipfs/ipfs-cluster/consensus/raft/consensus.go:119 +0x123
Previous write at 0x00c4204329f0 by goroutine 18:
github.com/ipfs/ipfs-cluster/consensus/raft.(*Consensus).SetClient()
/go/src/github.com/ipfs/ipfs-cluster/consensus/raft/consensus.go:179 +0x48
github.com/ipfs/ipfs-cluster.(*Cluster).setupRPCClients()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:190 +0x14f
github.com/ipfs/ipfs-cluster.NewCluster()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:136 +0xb98
github.com/ipfs/ipfs-cluster.testingCluster()
/go/src/github.com/ipfs/ipfs-cluster/cluster_test.go:106 +0x45b
github.com/ipfs/ipfs-cluster.TestClusterStateSync()
/go/src/github.com/ipfs/ipfs-cluster/cluster_test.go:147 +0x58
testing.tRunner()
/usr/local/go/src/testing/testing.go:746 +0x16c
Goroutine 33 (running) created at:
github.com/ipfs/ipfs-cluster/consensus/raft.NewConsensus()
/go/src/github.com/ipfs/ipfs-cluster/consensus/raft/consensus.go:88 +0x9d8
github.com/ipfs/ipfs-cluster.(*Cluster).setupConsensus()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:173 +0x200
github.com/ipfs/ipfs-cluster.NewCluster()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:131 +0xb74
github.com/ipfs/ipfs-cluster.testingCluster()
/go/src/github.com/ipfs/ipfs-cluster/cluster_test.go:106 +0x45b
github.com/ipfs/ipfs-cluster.TestClusterStateSync()
/go/src/github.com/ipfs/ipfs-cluster/cluster_test.go:147 +0x58
testing.tRunner()
/usr/local/go/src/testing/testing.go:746 +0x16c
Goroutine 18 (running) created at:
testing.(*T).Run()
/usr/local/go/src/testing/testing.go:789 +0x568
testing.runTests.func1()
/usr/local/go/src/testing/testing.go:1004 +0xa7
testing.tRunner()
/usr/local/go/src/testing/testing.go:746 +0x16c
testing.runTests()
/usr/local/go/src/testing/testing.go:1002 +0x521
testing.(*M).Run()
/usr/local/go/src/testing/testing.go:921 +0x206
main.main()
github.com/ipfs/ipfs-cluster/_test/_testmain.go:142 +0x1d3
==================
WARNING: DATA RACE
Read at 0x00c420432980 by goroutine 23:
github.com/ipfs/ipfs-cluster/consensus/raft.(*Consensus).Peers()
/go/src/github.com/ipfs/ipfs-cluster/consensus/raft/consensus.go:423 +0x57
github.com/ipfs/ipfs-cluster.(*Cluster).broadcastMetric()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:217 +0xbf
github.com/ipfs/ipfs-cluster.(*Cluster).pushInformerMetrics()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:287 +0x298
Previous write at 0x00c420432980 by goroutine 99:
github.com/ipfs/ipfs-cluster/consensus/raft.(*Consensus).Shutdown()
/go/src/github.com/ipfs/ipfs-cluster/consensus/raft/consensus.go:171 +0x34a
github.com/ipfs/ipfs-cluster.(*Cluster).Shutdown()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:559 +0xbcb
github.com/ipfs/ipfs-cluster.TestVersion()
/go/src/github.com/ipfs/ipfs-cluster/cluster_test.go:305 +0x102
testing.tRunner()
/usr/local/go/src/testing/testing.go:746 +0x16c
Goroutine 23 (running) created at:
github.com/ipfs/ipfs-cluster.(*Cluster).run()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:425 +0x94
github.com/ipfs/ipfs-cluster.NewCluster.func1()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:145 +0x69
Goroutine 99 (running) created at:
testing.(*T).Run()
/usr/local/go/src/testing/testing.go:789 +0x568
testing.runTests.func1()
/usr/local/go/src/testing/testing.go:1004 +0xa7
testing.tRunner()
/usr/local/go/src/testing/testing.go:746 +0x16c
testing.runTests()
/usr/local/go/src/testing/testing.go:1002 +0x521
testing.(*M).Run()
/usr/local/go/src/testing/testing.go:921 +0x206
main.main()
github.com/ipfs/ipfs-cluster/_test/_testmain.go:142 +0x1d3
==================
WARNING: DATA RACE
Write at 0x00c420276210 by goroutine 228:
runtime.mapassign_faststr()
/usr/local/go/src/runtime/hashmap_fast.go:774 +0x0
github.com/ipfs/ipfs-cluster/monitor/basic.(*Monitor).LogMetric()
/go/src/github.com/ipfs/ipfs-cluster/monitor/basic/peer_monitor.go:179 +0xa07
github.com/ipfs/ipfs-cluster.(*RPCAPI).PeerMonitorLogMetric()
/go/src/github.com/ipfs/ipfs-cluster/rpc_api.go:369 +0x94
runtime.call128()
/usr/local/go/src/runtime/asm_amd64.s:511 +0x51
reflect.Value.Call()
/usr/local/go/src/reflect/value.go:302 +0xc0
gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc.(*Server).Call()
/go/src/gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc/server.go:285 +0x5c3
gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc.(*Client).makeCall()
/go/src/gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc/client.go:119 +0x410
Previous read at 0x00c420276210 by goroutine 48:
runtime.mapiterinit()
/usr/local/go/src/runtime/hashmap.go:709 +0x0
github.com/ipfs/ipfs-cluster/monitor/basic.(*Monitor).monitor()
/go/src/github.com/ipfs/ipfs-cluster/monitor/basic/peer_monitor.go:287 +0x4af
Goroutine 228 (running) created at:
gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc.(*Client).CallContext()
/go/src/gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc/client.go:66 +0x13b
gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc.(*Client).Call()
/go/src/gx/ipfs/QmSvGoJcmisjcXr7x47LQuC3iW8BqTjh2RaqV17MUMRXQ3/go-libp2p-gorpc/client.go:58 +0xfa
github.com/ipfs/ipfs-cluster.(*Cluster).multiRPC.func1()
/go/src/github.com/ipfs/ipfs-cluster/cluster.go:1150 +0x189
Goroutine 48 (running) created at:
github.com/ipfs/ipfs-cluster/monitor/basic.(*Monitor).run()
/go/src/github.com/ipfs/ipfs-cluster/monitor/basic/peer_monitor.go:140 +0x17a
==================
WARNING: DATA RACE
Write at 0x00c420b7e238 by goroutine 100:
gx/ipfs/QmVxf27kucSvCLiCq6dAXjDU2WG3xZN9ae7Ny6osroP28u/yamux.(*Stream).SetReadDeadline()
/go/src/gx/ipfs/QmVxf27kucSvCLiCq6dAXjDU2WG3xZN9ae7Ny6osroP28u/yamux/stream.go:464 +0x4c
gx/ipfs/QmWp2mA7eab53PS4NdyW4uvBf73ZB7wSB7eN64K5pS1AKg/go-peerstream.(*Stream).SetReadDeadline()
/go/src/gx/ipfs/QmWp2mA7eab53PS4NdyW4uvBf73ZB7wSB7eN64K5pS1AKg/go-peerstream/stream.go:128 +0x73
gx/ipfs/QmSwZMWwFZSUpe5muU2xgTUwppH24KfMwdPXiwbEp2c6G5/go-libp2p-swarm.(*Stream).SetReadDeadline()
/go/src/gx/ipfs/QmSwZMWwFZSUpe5muU2xgTUwppH24KfMwdPXiwbEp2c6G5/go-libp2p-swarm/swarm_stream.go:64 +0x56
gx/ipfs/QmNh1kGFFdsPu79KNSaL4NUKUPb4Eiz4KHdMtFY6664RDp/go-libp2p/p2p/host/basic.(*streamWrapper).SetReadDeadline()
<autogenerated>:1 +0x7d
gx/ipfs/Qmdah9QB8iqQcehRbEqwmVnvGwDKd91oC8LUgdQNFu8gCY/go-libp2p-gostream.(*conn).SetReadDeadline()
/go/src/gx/ipfs/Qmdah9QB8iqQcehRbEqwmVnvGwDKd91oC8LUgdQNFu8gCY/go-libp2p-gostream/conn.go:62 +0x73
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*netPipeline).decodeResponses()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/net_transport.go:611 +0x4e2
Previous read at 0x00c420b7e238 by goroutine 139:
gx/ipfs/QmVxf27kucSvCLiCq6dAXjDU2WG3xZN9ae7Ny6osroP28u/yamux.(*Stream).Read()
/go/src/gx/ipfs/QmVxf27kucSvCLiCq6dAXjDU2WG3xZN9ae7Ny6osroP28u/yamux/stream.go:123 +0x1cc
gx/ipfs/QmWp2mA7eab53PS4NdyW4uvBf73ZB7wSB7eN64K5pS1AKg/go-peerstream.(*Stream).Read()
/go/src/gx/ipfs/QmWp2mA7eab53PS4NdyW4uvBf73ZB7wSB7eN64K5pS1AKg/go-peerstream/stream.go:80 +0x73
gx/ipfs/QmSwZMWwFZSUpe5muU2xgTUwppH24KfMwdPXiwbEp2c6G5/go-libp2p-swarm.(*Stream).Read()
/go/src/gx/ipfs/QmSwZMWwFZSUpe5muU2xgTUwppH24KfMwdPXiwbEp2c6G5/go-libp2p-swarm/swarm_stream.go:32 +0x5a
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.(*byteReader).ReadByte()
/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/multistream.go:399 +0xaa
encoding/binary.ReadUvarint()
/usr/local/go/src/encoding/binary/varint.go:110 +0x88
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.lpReadBuf()
/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/multistream.go:361 +0xbf
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.ReadNextTokenBytes()
/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/multistream.go:338 +0x81
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.ReadNextToken()
/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/multistream.go:329 +0x46
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.(*lazyConn).readHandshake()
/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/lazy.go:75 +0x1ce
Goroutine 100 (running) created at:
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.newNetPipeline()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/net_transport.go:599 +0x204
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*NetworkTransport).AppendEntriesPipeline()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/net_transport.go:324 +0xdc
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).pipelineReplicate()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/replication.go:370 +0xe8
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).replicate()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/replication.go:152 +0x3df
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).startStopReplication.func1()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/raft.go:447 +0x4a
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*raftState).goFunc.func1()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/state.go:146 +0x60
Goroutine 139 (running) created at:
gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream.(*lazyConn).Write()
/go/src/gx/ipfs/QmTnsezaB1wWNRHeHnYrm8K4d5i9wtyj3GsqjC3Rt5b5v5/go-multistream/lazy.go:115 +0x115
gx/ipfs/QmNh1kGFFdsPu79KNSaL4NUKUPb4Eiz4KHdMtFY6664RDp/go-libp2p/p2p/host/basic.(*streamWrapper).Write()
/go/src/gx/ipfs/QmNh1kGFFdsPu79KNSaL4NUKUPb4Eiz4KHdMtFY6664RDp/go-libp2p/p2p/host/basic/basic_host.go:554 +0x75
gx/ipfs/Qmdah9QB8iqQcehRbEqwmVnvGwDKd91oC8LUgdQNFu8gCY/go-libp2p-gostream.(*conn).Write()
/go/src/gx/ipfs/Qmdah9QB8iqQcehRbEqwmVnvGwDKd91oC8LUgdQNFu8gCY/go-libp2p-gostream/conn.go:32 +0x73
bufio.(*Writer).Flush()
/usr/local/go/src/bufio/bufio.go:567 +0x144
gx/ipfs/QmVTAmbCaPqdfbmpWDCJMQNFxbyJoG2USFsumXmTWY5LFp/go-codec/codec.(*ioEncWriter).atEndOfEncode()
/go/src/gx/ipfs/QmVTAmbCaPqdfbmpWDCJMQNFxbyJoG2USFsumXmTWY5LFp/go-codec/codec/encode.go:263 +0x86
gx/ipfs/QmVTAmbCaPqdfbmpWDCJMQNFxbyJoG2USFsumXmTWY5LFp/go-codec/codec.(*Encoder).MustEncode()
/go/src/gx/ipfs/QmVTAmbCaPqdfbmpWDCJMQNFxbyJoG2USFsumXmTWY5LFp/go-codec/codec/encode.go:1216 +0xa2
gx/ipfs/QmVTAmbCaPqdfbmpWDCJMQNFxbyJoG2USFsumXmTWY5LFp/go-codec/codec.(*Encoder).Encode()
/go/src/gx/ipfs/QmVTAmbCaPqdfbmpWDCJMQNFxbyJoG2USFsumXmTWY5LFp/go-codec/codec/encode.go:1205 +0x9b
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.sendRPC()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/net_transport.go:576 +0xb4
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*netPipeline).AppendEntries()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/net_transport.go:643 +0x280
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).pipelineSend()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/replication.go:430 +0xfe
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).pipelineReplicate()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/replication.go:407 +0x726
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).replicate()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/replication.go:152 +0x3df
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*Raft).startStopReplication.func1()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/raft.go:447 +0x4a
gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft.(*raftState).goFunc.func1()
/go/src/gx/ipfs/QmWh13Q23jcK2okVexqB49r8DsAKsC3etMgkp8b5ABj9wR/raft/state.go:146 +0x60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment