diff --git a/lib/protocol/protocol.go b/lib/protocol/protocol.go index f59695a25..4811f315e 100644 --- a/lib/protocol/protocol.go +++ b/lib/protocol/protocol.go @@ -289,6 +289,7 @@ func (c *rawConnection) Request(ctx context.Context, folder string, name string, c.awaitingMut.Lock() if _, ok := c.awaiting[id]; ok { + c.awaitingMut.Unlock() panic("id taken") } rc := make(chan asyncResult, 1) diff --git a/lib/rc/rc.go b/lib/rc/rc.go index 4ba43f52e..a6d658a15 100644 --- a/lib/rc/rc.go +++ b/lib/rc/rc.go @@ -547,6 +547,7 @@ func (p *Process) eventLoop() { } device := p.id.String() if device == "" { + p.eventMut.Unlock() panic("race, or startup not complete") } m[device] = version diff --git a/lib/util/utils.go b/lib/util/utils.go index 1851aa035..c8ff701c6 100644 --- a/lib/util/utils.go +++ b/lib/util/utils.go @@ -251,6 +251,7 @@ func (s *service) Stop() { s.mut.Lock() select { case <-s.ctx.Done(): + s.mut.Unlock() panic(fmt.Sprintf("Stop called more than once on %v", s)) default: s.cancel()