Skip to content

Commit

Permalink
Merge pull request #22985 from lambinoo/fix-hang-boot-podman
Browse files Browse the repository at this point in the history
Fix hang boot podman
  • Loading branch information
openshift-merge-bot[bot] authored Jul 9, 2024
2 parents abf0350 + c819c7a commit 6221e63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
// refresh runs.
runtime.valid = true

// Setup the worker channel early to start accepting jobs from refresh,
// but do not start to execute the jobs right away. The runtime is not
// ready at this point.
runtime.setupWorkerQueue()

// If we need to refresh the state, do it now - things are guaranteed to
// be set up by now.
if doRefresh {
Expand Down
5 changes: 4 additions & 1 deletion libpod/runtime_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

package libpod

func (r *Runtime) startWorker() {
func (r *Runtime) setupWorkerQueue() {
r.workerChannel = make(chan func(), 10)
}

func (r *Runtime) startWorker() {
go func() {
for w := range r.workerChannel {
w()
Expand Down

1 comment on commit 6221e63

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.