From 9822c3309c7cdd8ed66d0843104c10afca8bd79f Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 27 May 2021 16:51:24 +0200 Subject: 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 --- libpod/runtime.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libpod/runtime.go') 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. -- cgit v1.2.3-54-g00ecf