-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dht fixes #192
Conversation
@@ -272,7 +271,7 @@ func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.Peer, | |||
// Perhaps we were given closer peers | |||
var peers []peer.Peer | |||
for _, pb := range pmes.GetCloserPeers() { | |||
pr, err := dht.addPeer(pb) | |||
pr, err := dht.peerFromInfo(pb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whyrusleeping turns out that we don't want ensureConnectedToPeer
here, because we won't connect to all of these peers. That's why there was addPeer
. But addPeer
is now equivalent to peerFromInfo
, so i got rid of it as suggested :) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(You were right though, that we do need to connect to these peers. see note below in query)
@whyrusleeping i found the addresses issue. Then Listening, we don't learn the dialer's address. Because this address we're getting is the one they dialed from, not their proper one. Options:
peer info:
Oh yeah, that reminds me. The // in peer/
type AddrType string
const (
APIAddr = "api"
ListenAddr = "listen" // rename config.Addresses.Swarm -> config.Addresses.Listen ?
DialAddr = "dial" // may not even need to track these.
)
type Addrs map[string]ma.Multiaddr
func (* peer) Addresses() *Addrs { ... } Thoughts on both (a) peer info service, and (b) qualified addrs? |
Huh, so this is one of the same problems weve bee fighting for a while now... Im a fan of the option of just sending the addresses over during the handshake, its one less step and reduces complexity IMO. If you want to do the 'peer info' service though, i feel we should mold that into diagnostics, send a diagnostics message to the peer and ensure its not recursive, although, some people might not be okay with serving diagnostics information.. so that becomes weird too... As for qualified addresses, im not so sure we need them... i dont beleive we should care about other peers API ports, that just seems weird to me, and the address they dialed from shouldnt really matter because it means so many different things depending on the context (udp vs tcp vs anything else) |
The query-- once it's actually attempting to connect to a peer-- should be the one connecting.
dht doesn't need the whole network interface, only needs a Dialer. (much reduced surface of possible errors)
@whyrusleeping i think i fixed it. i no longer get Though this dhtHell test takes forever and lags my computer, invariably making me exit it.
I do see some:
|
@whyrusleeping quick CR + test it out pls |
The no request key happens when a node replies to a request that we dont care about anymore, seems pretty normal to me, especially if we ask two people for a value, and one returns first. We might want to handle that a little better, just to avoid logging confusion, but its not harming us any. I ran a bunch of large concurrent "get" tests in dhthell with expect, and they all passed. Gonna try for ~500 nodes later when i get back to my desktop. What specs does the machine youre running this on have? (the 100 node test you said was slow) |
(the reason i ask about specs, is because youre probably running out of RAM and swapping hard, thus causing the slowness) |
FWIW, my chromebook cant run 100 nodes either. |
} | ||
|
||
// ErrVersionMismatch is returned when two clients don't share a protocol version | ||
var ErrVersionMismatch = errors.New("protocol missmatch") | ||
|
||
// Compatible checks wether two versions are compatible | ||
// Handshake1Compatible checks wether two versions are compatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: whether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 88cc1e2
A couple comments, and i think we should have a README.md in the handshake package to clearly document the protocol. Just to make things even clearer and easier for anyone wanting to audit it, |
Yeah probably memory. what's the issue though? are we leaking all the things? we should be able to run 100 nodes no problem just sending messages. msgs should be garbage collected, etc. |
+:100: |
@whyrusleeping wat: https://travis-ci.org/jbenet/go-ipfs/jobs/38748767 never seen that before |
yeah, thats a bug i need to fix, see #141 |
essentially, whats happenening is this: |
Fixing dht issues.