Skip to content

Commit

Permalink
Merge pull request #3728 from nspcc-dev/blockfetcher-close
Browse files Browse the repository at this point in the history
Fix blockfetcher closing
  • Loading branch information
AnnaShaleva authored Dec 6, 2024
2 parents 49267f3 + 109319d commit a68856c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/network/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ func newServerFromConstructors(config ServerConfig, chain Ledger, stSync StateSy
s.bSyncQueue = bqueue.New(s.stateSync, log, nil, bqueue.DefaultCacheSize, updateBlockQueueLenMetric, bqueue.NonBlocking)
s.bFetcherQueue = bqueue.New(chain, log, nil, s.NeoFSBlockFetcherCfg.BQueueSize, updateBlockQueueLenMetric, bqueue.Blocking)
var err error
s.blockFetcher, err = blockfetcher.New(chain, s.NeoFSBlockFetcherCfg, log, s.bFetcherQueue.PutBlock, func() {
close(s.blockFetcherFin)
})
s.blockFetcher, err = blockfetcher.New(chain, s.NeoFSBlockFetcherCfg, log, s.bFetcherQueue.PutBlock,
sync.OnceFunc(func() { close(s.blockFetcherFin) }))
if err != nil {
return nil, fmt.Errorf("failed to create NeoFS BlockFetcher: %w", err)
}
Expand Down Expand Up @@ -575,6 +574,7 @@ func (s *Server) run() {
s.tryInitStateSync()
s.tryStartServices()
}
s.blockFetcherFin = nil
}
}
}
Expand Down

0 comments on commit a68856c

Please sign in to comment.