Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions staticaddr/loopin/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,25 @@ func (m *Manager) Run(ctx context.Context) error {
case request.respChan <- resp:

case <-ctx.Done():
// Noify subroutines that the main loop has been
// canceled.
// Notify subroutines that the main loop has
// been canceled.
close(m.exitChan)

return ctx.Err()
}

case sweepReq := <-sweepReqs:
case sweepReq, ok := <-sweepReqs:
if !ok {
// The channel has been closed, we'll stop the
// loop-in manager.
log.Debugf("Stopping loop-in manager " +
"(ntfnChan closed)")

close(m.exitChan)

return fmt.Errorf("ntfnChan closed")
}

err = m.handleLoopInSweepReq(ctx, sweepReq)
if err != nil {
log.Errorf("Error handling loop-in sweep "+
Expand Down