Skip to content

Commit

Permalink
fix: return peers with no addrs that wont probe
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Dec 5, 2024
1 parent b536e82 commit 7182699
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server_cached_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,14 @@ func (it *cacheFallbackIter) Next() bool {
it.ongoingLookups.Add(1) // important to increment before dispatchFindPeer
// If a record has no addrs, we dispatch a lookup to find addresses
go it.dispatchFindPeer(*record)

return it.Next() // Recursively call Next() to either read from sourceIter or wait for lookup result
}

return it.Next() // Recursively call Next() to either read from sourceIter or wait for lookup result
// If we're not going to probe, return the record with no addrs
// TODO: should we even return these if the peer is likely unreachable?
it.current = iter.Result[types.Record]{Val: record}
return true

Check warning on line 171 in server_cached_router.go

View check run for this annotation

Codecov / codecov/patch

server_cached_router.go#L170-L171

Added lines #L170 - L171 were not covered by tests
}

switch val.Val.GetSchema() {
Expand Down

0 comments on commit 7182699

Please sign in to comment.