Skip to content

Commit

Permalink
Merge pull request docker#2066 from jsternberg/early-flock-release
Browse files Browse the repository at this point in the history
commands: release the file lock before attempting to boot during create
  • Loading branch information
crazy-max authored Sep 30, 2023
2 parents 2c2294f + 0878d5b commit a012e00
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
if err != nil {
return err
}
// Ensure the file lock gets released no matter what happens.
defer release()

name := in.name
Expand Down Expand Up @@ -300,6 +301,10 @@ func runCreate(dockerCli command.Cli, in createOptions, args []string) error {
}
}

// The store is no longer used from this point.
// Release it so we aren't holding the file lock during the boot.
release()

if in.bootstrap {
if _, err = b.Boot(ctx); err != nil {
return err
Expand Down

0 comments on commit a012e00

Please sign in to comment.