Skip to content

Commit

Permalink
Incorporate PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Sep 28, 2023
1 parent a4f0950 commit 97e9fbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions v2/internal/coord/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,13 @@ func (c *Coordinator) NotifyConnectivity(ctx context.Context, id kadt.PeerID) {

// NotifyNonConnectivity notifies the coordinator that a peer has failed a connectivity check
// which means it is not connected and/or it doesn't support finding closer nodes
func (c *Coordinator) NotifyNonConnectivity(ctx context.Context, id kadt.PeerID) error {
func (c *Coordinator) NotifyNonConnectivity(ctx context.Context, id kadt.PeerID) {
ctx, span := c.tele.Tracer.Start(ctx, "Coordinator.NotifyNonConnectivity")
defer span.End()

c.routingBehaviour.Notify(ctx, &EventNotifyNonConnectivity{
NodeID: id,
})

Check warning on line 609 in v2/internal/coord/coordinator.go

View check run for this annotation

Codecov / codecov/patch

v2/internal/coord/coordinator.go#L603-L609

Added lines #L603 - L609 were not covered by tests

return nil
}

func (c *Coordinator) newOperationID() coordt.QueryID {
Expand Down
2 changes: 1 addition & 1 deletion v2/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (d *DHT) searchValueRoutine(ctx context.Context, backend Backend, ns string

_, _, err := d.kad.QueryMessage(ctx, req, fn, d.cfg.BucketSize)
if err != nil {
d.log.Warn("Search value query failed", slog.String("err", err.Error()))
d.logErr(err, "Search value query failed")
return
}

Expand Down
5 changes: 3 additions & 2 deletions v2/routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ LOOP:
}

func TestDHT_FindProvidersAsync_queries_other_peers(t *testing.T) {
ctx := context.Background() // kadtest.CtxShort(t)
ctx := kadtest.CtxShort(t)

c := newRandomContent(t)

Expand Down Expand Up @@ -599,8 +599,9 @@ func TestDHT_SearchValue_returns_best_values(t *testing.T) {
// Test setup:
// d2 returns no value
// d3 returns valid value
// d4 returns worse value
// d4 returns worse value (will get rejected because we already have a valid value)
// d5 returns better value
// all peers are connected in a chain from d1 to d5 (d1 initiates the query)
// assert that we receive two values on the channel (valid + better)
ctx := kadtest.CtxShort(t)
clk := clock.New()
Expand Down

0 comments on commit 97e9fbe

Please sign in to comment.