summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-26 13:37:40 +0200
committerGitHub <noreply@github.com>2022-09-26 13:37:40 +0200
commit1d63d9f488091c4bb82622d7bc22bb81d5c4eed2 (patch)
tree3d0fd12c05a9c08bcba5672d898bfaf17b8e9fff /pkg/domain
parent17f3756884f2f65a1da753e5b58895dc0b9145e8 (diff)
parent4a053a821aab8891498cb5dd3f01ce3437fdf0ef (diff)
downloadpodman-1d63d9f488091c4bb82622d7bc22bb81d5c4eed2.tar.gz
podman-1d63d9f488091c4bb82622d7bc22bb81d5c4eed2.tar.bz2
podman-1d63d9f488091c4bb82622d7bc22bb81d5c4eed2.zip
Merge pull request #15820 from vrothberg/fix-15800
kube: notifyproxy: fix lost READY message
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/play.go22
1 files changed, 19 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index 847e81e69..bd9117f72 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -10,6 +10,7 @@ import (
"path/filepath"
"strconv"
"strings"
+ "sync"
buildahDefine "github.com/containers/buildah/define"
"github.com/containers/common/libimage"
@@ -698,9 +699,24 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
fmt.Println(playKubePod.ContainerErrors)
}
- // Wait for each proxy to receive a READY message.
- for _, proxy := range sdNotifyProxies {
- if err := proxy.WaitAndClose(); err != nil {
+ // Wait for each proxy to receive a READY message. Use a wait
+ // group to prevent the potential for ABBA kinds of deadlocks.
+ var wg sync.WaitGroup
+ errors := make([]error, len(sdNotifyProxies))
+ for i := range sdNotifyProxies {
+ wg.Add(1)
+ go func(i int) {
+ err := sdNotifyProxies[i].WaitAndClose()
+ if err != nil {
+ err = fmt.Errorf("waiting for sd-notify proxy: %w", err)
+ }
+ errors[i] = err
+ wg.Done()
+ }(i)
+ }
+ wg.Wait()
+ for _, err := range errors {
+ if err != nil {
return nil, err
}
}