From 3fb9f6ddbab23006885327d935a53181239747b0 Mon Sep 17 00:00:00 2001 From: Fred Rolland Date: Sun, 10 Jul 2022 12:23:12 +0300 Subject: [PATCH] Wait for writer response on Refresh When sending a Refresh message to Writer's refresh channel, if the state is "Succeeded" or "Failed", the Writer will update the sync channel when finished. Therefore there is a need to wait on sync channel on the Daemon side when sending "Succeeded" or "Failed". Signed-off-by: Fred Rolland --- pkg/daemon/daemon.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 73f7ebb93..743b4b106 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -413,6 +413,8 @@ func (dn *Daemon) nodeStateSyncHandler(generation int64) error { syncStatus: "Succeeded", lastSyncError: "", } + // wait for writer to refresh the status + <-dn.syncCh } return nil