mirror of
https://github.com/containers/podman.git
synced 2025-06-19 16:33:24 +08:00
libpod API: pull: fix channel race
Fix a race condition in the pull endpoint caused by buffered channels. Using buffered channels can lead to the context's cancel function to be executed prior to the items being read from the channel. Fixes: #8870 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -115,10 +115,10 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
writer := channel.NewWriter(make(chan []byte, 1))
|
||||
writer := channel.NewWriter(make(chan []byte))
|
||||
defer writer.Close()
|
||||
|
||||
stderr := channel.NewWriter(make(chan []byte, 1))
|
||||
stderr := channel.NewWriter(make(chan []byte))
|
||||
defer stderr.Close()
|
||||
|
||||
images := make([]string, 0, len(imagesToPull))
|
||||
|
Reference in New Issue
Block a user