From ff0a83fe5b6721bce13eb80abb7339c33cb771fb Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Wed, 25 Oct 2017 19:34:38 +0000 Subject: [PATCH 1/2] vendor: Fix kcp deadlock GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4461 --- vendor/github.com/AudriusButkevicius/kcp-go/blacklist.go | 2 +- vendor/manifest | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/github.com/AudriusButkevicius/kcp-go/blacklist.go b/vendor/github.com/AudriusButkevicius/kcp-go/blacklist.go index 41415bb6..718dbb0a 100644 --- a/vendor/github.com/AudriusButkevicius/kcp-go/blacklist.go +++ b/vendor/github.com/AudriusButkevicius/kcp-go/blacklist.go @@ -42,7 +42,7 @@ func (m *blacklistMap) has(address string, conv uint32) bool { addr: address, convID: conv, }] - m.mut.Lock() + m.mut.Unlock() return ok && t.After(time.Now()) } diff --git a/vendor/manifest b/vendor/manifest index 94d66ce1..df920ce9 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -21,7 +21,7 @@ "importpath": "github.com/AudriusButkevicius/kcp-go", "repository": "https://github.com/AudriusButkevicius/kcp-go", "vcs": "git", - "revision": "54928af49abc3a4e5b645f42466a56cebc4a941e", + "revision": "8ae5f528469c6ab76110f41eb7a51341b7efb946", "branch": "master", "notests": true }, From 2953fe40d13f3ddced0dd9f30a06823831a15a64 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 26 Oct 2017 11:49:06 +0000 Subject: [PATCH 2/2] lib/model: Add initial noop watch cancel func (fixes #4464) GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4465 --- lib/model/folder.go | 1 + lib/model/rofolder.go | 2 +- lib/model/rwfolder.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/model/folder.go b/lib/model/folder.go index f3874edc..ce7459e9 100644 --- a/lib/model/folder.go +++ b/lib/model/folder.go @@ -40,6 +40,7 @@ func newFolder(model *Model, cfg config.FolderConfiguration) folder { cancel: cancel, model: model, initialScanFinished: make(chan struct{}), + watchCancel: func() {}, } } diff --git a/lib/model/rofolder.go b/lib/model/rofolder.go index 7a665776..b7a56710 100644 --- a/lib/model/rofolder.go +++ b/lib/model/rofolder.go @@ -34,7 +34,7 @@ func (f *sendOnlyFolder) Serve() { f.scan.timer.Stop() }() - if f.FSWatcherEnabled { + if f.FSWatcherEnabled && f.CheckHealth() == nil { f.startWatch() } diff --git a/lib/model/rwfolder.go b/lib/model/rwfolder.go index 793d6448..e524354f 100644 --- a/lib/model/rwfolder.go +++ b/lib/model/rwfolder.go @@ -164,7 +164,7 @@ func (f *sendReceiveFolder) Serve() { var prevSec int64 var prevIgnoreHash string - if f.FSWatcherEnabled { + if f.FSWatcherEnabled && f.CheckHealth() == nil { f.startWatch() }