File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -205,14 +205,25 @@ func (m *Manager) Run(ctx context.Context) error {
205205 case request .respChan <- resp :
206206
207207 case <- ctx .Done ():
208- // Noify subroutines that the main loop has been
209- // canceled.
208+ // Notify subroutines that the main loop has
209+ // been canceled.
210210 close (m .exitChan )
211211
212212 return ctx .Err ()
213213 }
214214
215- case sweepReq := <- sweepReqs :
215+ case sweepReq , ok := <- sweepReqs :
216+ if ! ok {
217+ // The channel has been closed, we'll stop the
218+ // loop-in manager.
219+ log .Debugf ("Stopping loop-in manager " +
220+ "(ntfnChan closed)" )
221+
222+ close (m .exitChan )
223+
224+ return fmt .Errorf ("ntfnChan closed" )
225+ }
226+
216227 err = m .handleLoopInSweepReq (ctx , sweepReq )
217228 if err != nil {
218229 log .Errorf ("Error handling loop-in sweep " +
You can’t perform that action at this time.
0 commit comments