diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2018-10-12 02:32:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-12 02:32:14 +0800 |
commit | dcae0d348bb7f5d9052e50a83383a33538ce376a (patch) | |
tree | 9dee15f209bd31c3adf32fef3835a06bda8f18e4 /p2p/simulations/README.md | |
parent | f951e23fb5ad2f7017f314a95287bc0506a67d05 (diff) | |
download | dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.tar dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.tar.gz dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.tar.bz2 dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.tar.lz dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.tar.xz dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.tar.zst dexon-dcae0d348bb7f5d9052e50a83383a33538ce376a.zip |
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.
Diffstat (limited to 'p2p/simulations/README.md')
-rw-r--r-- | p2p/simulations/README.md | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/p2p/simulations/README.md b/p2p/simulations/README.md index d1f8649ea..871d71b2c 100644 --- a/p2p/simulations/README.md +++ b/p2p/simulations/README.md @@ -63,18 +63,6 @@ using the devp2p node stack rather than executing `main()`. The nodes listen for devp2p connections and WebSocket RPC clients on random localhost ports. -### DockerAdapter - -The `DockerAdapter` is similar to the `ExecAdapter` but executes `docker run` -to run the node in a Docker container using a Docker image containing the -simulation binary at `/bin/p2p-node`. - -The Docker image is built using `docker build` when the adapter is initialised, -meaning no prior setup is necessary other than having a working Docker client. - -Each node listens on the external IP of the container and the default p2p and -RPC ports (`30303` and `8546` respectively). - ## Network A simulation network is created with an ID and default service (which is used |