You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be a deadlock when relocating certain images. This was first noticed in Porter (getporter/porter#3311) and also observed when running cnab-to-oci directly.
The scheduler todoList fills up with the maximum number of items (50) and then blocks indefinitely.
From my very limited understanding of the code, this is what I think is happening:
(*manifestWalker).walk pushes a task onto the scheduler
the task is processed by a scheduler worker thread and executed
when executed, the task iterates over the manifest children and calls walk() which then pushes a new task onto the scheduler for each child
if there is no space in the scheduler to push the child tasks, the parent task becomes blocked, which blocks that worker thread
if all 4 worker threads become blocked by tasks which are waiting for space in the scheduler, there is a deadlock
This is just a guess, I'm not a Go programmer and am not familiar with the code for this project but hopefully it will point someone in the right direction.
I was able to work around this issue and successfully push my bundle by increasing the defaultJobsBufferLength in remotes/fixupoptions.go to an arbitrary higher number (500).
To Reproduce
Steps to reproduce the behavior:
Create new Porter bundle: porter create
Add images section containing postgres to porter.yaml:
images:
postgres:
repository: postgrestag: 17.2# or digest: sha256:888402a8cd6075c5dc83a31f58287f13306c318eaad016661ed12e076f3e6341
Build the bundle: porter build
Start a local registry: docker run -d -p 5000:5000 --name registry registry:2
Push the bundle: cnab-to-oci push .cnab/bundle.json --target localhost:5000/porter-hello:v0.1.0 --auto-update-bundle
Push gets stuck on "Starting to copy image postgres@sha256:888402..."
Describe the bug
There appears to be a deadlock when relocating certain images. This was first noticed in Porter (getporter/porter#3311) and also observed when running cnab-to-oci directly.
The scheduler
todoList
fills up with the maximum number of items (50) and then blocks indefinitely.Stack trace at point of deadlock:
From my very limited understanding of the code, this is what I think is happening:
(*manifestWalker).walk
pushes a task onto the schedulerwalk()
which then pushes a new task onto the scheduler for each childThis is just a guess, I'm not a Go programmer and am not familiar with the code for this project but hopefully it will point someone in the right direction.
I was able to work around this issue and successfully push my bundle by increasing the
defaultJobsBufferLength
in remotes/fixupoptions.go to an arbitrary higher number (500).To Reproduce
Steps to reproduce the behavior:
porter create
porter build
docker run -d -p 5000:5000 --name registry registry:2
cnab-to-oci push .cnab/bundle.json --target localhost:5000/porter-hello:v0.1.0 --auto-update-bundle
Expected Behavior
The bundle should be pushed successfully.
Command and Output
Version
Current master branch (e51b130)
The text was updated successfully, but these errors were encountered: