Skip to content

Commit

Permalink
timeout identify exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Jun 19, 2023
1 parent 2317f90 commit 812c0ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/crawl/crawl_p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (c *Crawler) fetchNeighbors(ctx context.Context, pi peer.AddrInfo) (*Routin
// identified in the past. We detect a successful identification if an
// AgentVersion is stored in the peer store
func (c *Crawler) identifyWait(ctx context.Context, pi peer.AddrInfo) {
idCtx, cancel := context.WithCancel(ctx)
timeoutCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
defer cancel()

var wg sync.WaitGroup
Expand All @@ -227,7 +227,7 @@ func (c *Crawler) identifyWait(ctx context.Context, pi peer.AddrInfo) {
defer wg.Done()

select {
case <-idCtx.Done():
case <-timeoutCtx.Done():
case <-c.host.IDService().IdentifyWait(conn):

// check if identification was successful by looking for
Expand Down

0 comments on commit 812c0ba

Please sign in to comment.