From 3a0c7c61532db7f8e4ce79f99129201a79729525 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 29 Jun 2019 22:22:34 +0100 Subject: plugin/file: load secondary zones lazily on startup (#2944) This fixes a long standing bug: fixes: #1609 Load secondary zones in a go-routine; this required another mutex to protect some fields; I think those were needded anyway because a transfer can also happen when we're running; we just didn't have a test for that situation. The test had to be changed to wait for the transfer to happen at this is async now. Signed-off-by: Miek Gieben --- plugin/file/secondary.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugin/file/secondary.go') diff --git a/plugin/file/secondary.go b/plugin/file/secondary.go index 049fe0cda..ed94daad6 100644 --- a/plugin/file/secondary.go +++ b/plugin/file/secondary.go @@ -51,9 +51,11 @@ Transfer: return Err } + z.apexMu.Lock() z.Tree = z1.Tree z.Apex = z1.Apex *z.Expired = false + z.apexMu.Unlock() log.Infof("Transferred: %s from %s", z.origin, tr) return nil } -- cgit v1.2.3