go-ethereum/p2p/simulations/adapters
Felix Lange dcae0d348b
p2p/simulations: fix a deadlock and clean up adapters (#17891)
This fixes a rare deadlock with the inproc adapter:

- A node is stopped, which acquires Network.lock.
- The protocol code being simulated (swarm/network in my case)
  waits for its goroutines to shut down.
- One of those goroutines calls into the simulation to add a peer,
  which waits for Network.lock.

The fix for the deadlock is really simple, just release the lock
before stopping the simulation node.

Other changes in this PR clean up the exec adapter so it reports
node startup errors better and remove the docker adapter because
it just adds overhead.

In the exec adapter, node information is now posted to a one-shot
server. This avoids log parsing and allows reporting startup
errors to the simulation host.

A small change in package node was needed because simulation
nodes use port zero. Node.{HTTP,WS}Endpoint now return the live
endpoints after startup by checking the TCP listener.
2018-10-11 20:32:14 +02:00
..
exec.go p2p/simulations: fix a deadlock and clean up adapters (#17891) 2018-10-11 20:32:14 +02:00
inproc.go all: new p2p node representation (#17643) 2018-09-25 00:59:00 +02:00
inproc_test.go all: library changes for swarm-network-rewrite (#16898) 2018-06-14 11:21:17 +02:00
types.go all: new p2p node representation (#17643) 2018-09-25 00:59:00 +02:00