diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-05-27 16:51:24 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-05-27 16:52:56 +0200 |
commit | 9822c3309c7cdd8ed66d0843104c10afca8bd79f (patch) | |
tree | f58c9bc5d0559db961f370754d27d551b2ce944f | |
parent | cd1f99d063cf8bb4efdb22d2f56f1aef73ff4ba0 (diff) | |
download | podman-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>
-rw-r--r-- | libpod/runtime.go | 3 |
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. |