From b91ff430dbcbea2b198acf2b4e152687d1290394 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sun, 24 Jun 2018 17:55:28 +0200 Subject: [PATCH] lib/model: Release both locks when waiting for services to stop (fixes #5028) --- lib/model/model.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/model/model.go b/lib/model/model.go index 302f06c5b..fba9c2f8b 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -344,11 +344,13 @@ func (m *Model) tearDownFolderLocked(cfg config.FolderConfiguration) { // Stop the services running for this folder and wait for them to finish // stopping to prevent races on restart. tokens := m.folderRunnerTokens[cfg.ID] + m.pmut.Unlock() m.fmut.Unlock() for _, id := range tokens { m.RemoveAndWait(id, 0) } m.fmut.Lock() + m.pmut.Lock() // Close connections to affected devices for _, dev := range cfg.Devices {