Skip to content

Fix hang boot podman #22985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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