File tree 1 file changed +14
-3
lines changed
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 {
205
205
case request .respChan <- resp :
206
206
207
207
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.
210
210
close (m .exitChan )
211
211
212
212
return ctx .Err ()
213
213
}
214
214
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
+
216
227
err = m .handleLoopInSweepReq (ctx , sweepReq )
217
228
if err != nil {
218
229
log .Errorf ("Error handling loop-in sweep " +
You can’t perform that action at this time.
0 commit comments