File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,13 @@ func (m *SyncManager) roundRobinHandler() {
286
286
current = m .nextPendingActiveSyncer ()
287
287
m .Unlock ()
288
288
for current != nil {
289
+ // Ensure we properly handle a shutdown signal.
290
+ select {
291
+ case <- m .quit :
292
+ return
293
+ default :
294
+ }
295
+
289
296
// We'll avoid performing the transition with the lock
290
297
// as it can potentially stall the SyncManager due to
291
298
// the syncTransitionTimeout.
@@ -531,6 +538,13 @@ func (m *SyncManager) forceHistoricalSync() {
531
538
candidatesChosen := make (map [routing.Vertex ]struct {})
532
539
s := m .chooseRandomSyncer (candidatesChosen , true )
533
540
for s != nil {
541
+ // Ensure we properly handle a shutdown signal.
542
+ select {
543
+ case <- m .quit :
544
+ return
545
+ default :
546
+ }
547
+
534
548
// Blacklist the candidate to ensure it's not chosen again.
535
549
candidatesChosen [s .cfg .peerPub ] = struct {}{}
536
550
You can’t perform that action at this time.
0 commit comments