diff --git a/command/console.go b/command/console.go index 9974fb8e8..81ba3a8a9 100644 --- a/command/console.go +++ b/command/console.go @@ -97,6 +97,7 @@ func (c *ConsoleCommand) Run(args []string) int { // Get the context ctx, _, ctxDiags := local.Context(opReq) + // Creating the context can result in a lock, so ensure we release it defer func() { err := opReq.StateLocker.Unlock(nil) if err != nil { diff --git a/command/import.go b/command/import.go index 96e35fb35..5996040d8 100644 --- a/command/import.go +++ b/command/import.go @@ -204,6 +204,7 @@ func (c *ImportCommand) Run(args []string) int { // Get the context ctx, state, ctxDiags := local.Context(opReq) + // Creating the context can result in a lock, so ensure we release it defer func() { err := opReq.StateLocker.Unlock(nil) if err != nil {