Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
a7eb52a7
Commit
a7eb52a7
authored
Dec 23, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dht: helpful debugging for no closer peers
parent
64a4abcd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
routing/dht/query.go
routing/dht/query.go
+5
-2
routing/dht/routing.go
routing/dht/routing.go
+1
-0
No files found.
routing/dht/query.go
View file @
a7eb52a7
...
...
@@ -258,12 +258,15 @@ func (r *dhtQueryRunner) queryPeer(p peer.ID) {
r
.
Unlock
()
r
.
cancel
()
// signal to everyone that we're done.
}
else
if
res
.
closerPeers
!=
nil
{
log
.
Debugf
(
"PEERS CLOSER -- worker for: %v
"
,
p
)
}
else
if
len
(
res
.
closerPeers
)
>
0
{
log
.
Debugf
(
"PEERS CLOSER -- worker for: %v
(%d closer peers)"
,
p
,
len
(
res
.
closerPeers
)
)
for
_
,
next
:=
range
res
.
closerPeers
{
// add their addresses to the dialer's peerstore
r
.
query
.
dialer
.
Peerstore
()
.
AddAddresses
(
next
.
ID
,
next
.
Addrs
)
r
.
addPeerToQuery
(
next
.
ID
,
p
)
log
.
Debugf
(
"PEERS CLOSER -- worker for: %v added %v (%v)"
,
p
,
next
.
ID
,
next
.
Addrs
)
}
}
else
{
log
.
Debugf
(
"QUERY worker for: %v - not found, and no closer peers."
,
p
)
}
}
routing/dht/routing.go
View file @
a7eb52a7
...
...
@@ -139,6 +139,7 @@ func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key u.Key, count int
func
(
dht
*
IpfsDHT
)
findProvidersAsyncRoutine
(
ctx
context
.
Context
,
key
u
.
Key
,
count
int
,
peerOut
chan
peer
.
PeerInfo
)
{
defer
close
(
peerOut
)
log
.
Debugf
(
"%s FindProviders %s"
,
dht
.
self
,
key
)
ps
:=
pset
.
NewLimited
(
count
)
provs
:=
dht
.
providers
.
GetProviders
(
ctx
,
key
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment