summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-05-27 16:51:24 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-05-27 16:52:56 +0200
commit9822c3309c7cdd8ed66d0843104c10afca8bd79f (patch)
treef58c9bc5d0559db961f370754d27d551b2ce944f /libpod
parentcd1f99d063cf8bb4efdb22d2f56f1aef73ff4ba0 (diff)
downloadpodman-9822c3309c7cdd8ed66d0843104c10afca8bd79f.tar.gz
podman-9822c3309c7cdd8ed66d0843104c10afca8bd79f.tar.bz2
podman-9822c3309c7cdd8ed66d0843104c10afca8bd79f.zip
create libimage-events channel in main routine
Move the creation of the channel outside of the sub-routine to fix a data race between writing the channel (implicitly by calling EventChannel()) and using that channel in libimage. [NO TESTS NEEDED] Fixes: #10459 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index d14048311..d775b55e1 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -715,9 +715,8 @@ func (r *Runtime) libimageEvents() {
return status
}
+ eventChannel := r.libimageRuntime.EventChannel()
go func() {
- eventChannel := r.libimageRuntime.EventChannel()
-
for {
// Make sure to read and write all events before
// checking if we're about to shutdown.