From 4eadbd85b83ada55f5839478763dd425fcb402a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A1ndor=20Istv=C3=A1n=20Kr=C3=A1cser?= Date: Fri, 27 Apr 2018 14:24:54 +0200 Subject: [PATCH] Make sure final value arrives to DoneCh() always stopCh is already selected in renewAuth() and renewLease(), so this case block is not needed here and otherwise, it causes a race condition and sometimes the final result doesn't arrive in the DoneCh() --- api/renewer.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/renewer.go b/api/renewer.go index 7fd1de7db20d..47be91519248 100644 --- a/api/renewer.go +++ b/api/renewer.go @@ -166,10 +166,7 @@ func (r *Renewer) Renew() { result = r.renewLease() } - select { - case r.doneCh <- result: - case <-r.stopCh: - } + r.doneCh <- result } // renewAuth is a helper for renewing authentication.