Withe queries (particularly providers), it was possible to
exit the query runner's Run BEFORE all its children were done,
because the runner itself only listened to the context. This
introduced the possibility of a panic (you can go check it
out by running the TestProvidersMany test on dht_test in commits
before this one). Thankfully, ctxgroup saved the day with
almost _zero_ changes to the sync flow, and now we have the
guarantee that the query runner will only exit if all its
children are done. ❤️
Conflicts:
routing/dht/query.go
This commit introduces a reader and writer that respect
contexts. Warning: careful how you use them. Returning
leaves a goroutine reading until the read finishes.
Had to change the network interface from DialPeer(peer.ID) to
DialPeer(peer.PeerInfo), so that addresses of a provider are
handed to the network.
@maybebtc and I are discussing whether this should go all the
way down to the network, or whether the network _should always
work_ with just an ID (which means the network needs to be
able to resolve ID -> Addresses, using the routing system.
This latter point might mean that "routing" might need to
break down into subcomponents. It's a bit sketchy that
the Network would become smarter than just dial/listen and
I/O, but maybe there's a distinction between net.Network,
and something like a peernet.Network that has routing
built in...)
https://build.protocol-dev.com/job/race/9352/console
@jbenet @whyrusleeping
pinging you guys to spread awareness about the delay.D type for
configurable delays
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
- run the build image task every time to avoid
running the test on stale code
- run the test from a script, so that we can
run the test on different pre-built images.
like:
# build an image now and run tests on it
make test
# run tests on previously built image
./run-test-on-img.sh ipfs-stable
# TODO: run test on git ref
./run-test-on-git-ref.sh <git-ref>
this commit changes how the dockertest image is built.
it moves the command into dockertest/Makefile. It also
uses a cached file that -- if removed with make clean
-- can signal whether the image should be rebuilt.
(it may be ideal to have it either detect code has
changed, or just rebuild every time. )
some dht tests signaled "sending peer empty addresses"
which would then cause a failure. this was a misrepresentation
on the part of mocknet. it has been corrected.
- Make sure we call IdentifyConn on dialed out conns
- we wait until the identify is **done** before return
- on listening case, we can also wait.
- tests now make sure dial does wait.
- tests now make sure we can wait on listening case.