Fix: deadlock on dns shutdown when starting up

This commit is contained in:
Quentin McGaw (desktop)
2021-07-16 20:11:57 +00:00
parent 7c44188130
commit 8185979ca4

View File

@@ -96,7 +96,10 @@ func (l *looper) logAndWait(ctx context.Context, err error) {
func (l *looper) signalOrSetStatus(userTriggered *bool, status models.LoopStatus) {
if *userTriggered {
*userTriggered = false
l.running <- status
select {
case l.running <- status:
default: // receiver droppped out - avoid deadlock on events routing when shutting down
}
} else {
l.state.SetStatus(status)
}