backport of commit bc9a39a2f1 (#20954)

Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
This commit is contained in:
hc-github-team-secure-vault-core
2023-06-02 09:34:20 -04:00
committed by GitHub
parent 2d077fc6f9
commit 08cbaab36e

View File

@@ -320,8 +320,11 @@ func (s *Server) restartChildProcess(newEnvVars []string) error {
// race condition with ExitCh not being initialized.
go func() {
select {
case exitCode := <-proc.ExitCh():
s.childProcessExitCh <- exitCode
case exitCode, ok := <-proc.ExitCh():
// ignore ExitCh channel closures caused by our restarts
if ok {
s.childProcessExitCh <- exitCode
}
}
}()