terraform/backend/local
James Bardin 7cba68326a always wait for a RunningOperation to return
If the user wishes to interrupt the running operation, only the first
interrupt was communicated to the operation by canceling the provided
context. A second interrupt would start the shutdown process, but not
communicate this to the running operation. This order of event could
cause partial writes of state.

What would happen is that once the command returns, the plugin system
would stop the provider processes. Once the provider processes dies, all
pending Eval operations would return return with an error, and quickly
cause the operation to complete. Since the backend code didn't know that
the process was shutting down imminently, it would continue by
attempting to write out the last known state. Under the right
conditions, the process would exit part way through the writing of the
state file.

Add Stop and Cancel CancelFuncs to the RunningOperation, to allow it to
easily differentiate between the two signals. The backend will then be
able to detect a shutdown and abort more gracefully.

In order to ensure that the backend is not in the process of writing the
state out, the command will always attempt to wait for the process to
complete after cancellation.
2018-02-12 11:56:03 -05:00
..
test-fixtures core: Move Refreh/Plan diff count to general operation test 2017-06-24 07:54:40 -07:00
backend.go always wait for a RunningOperation to return 2018-02-12 11:56:03 -05:00
backend_apply.go always wait for a RunningOperation to return 2018-02-12 11:56:03 -05:00
backend_apply_test.go update test state strings for backend/local 2017-11-07 21:23:10 -05:00
backend_local.go return tfdiags.Diagnostics from validation methods 2017-11-28 11:15:29 -08:00
backend_plan.go always wait for a RunningOperation to return 2018-02-12 11:56:03 -05:00
backend_plan_test.go cannot destroy without a config 2017-11-07 21:23:37 -05:00
backend_refresh.go always wait for a RunningOperation to return 2018-02-12 11:56:03 -05:00
backend_refresh_test.go update test state strings for backend/local 2017-11-07 21:23:10 -05:00
backend_test.go update test state strings for backend/local 2017-11-07 21:23:10 -05:00
cli.go cli: allow disabling "next steps" message in terraform plan 2017-09-14 10:51:41 -07:00
counthookaction_string.go Update various files for new version of "stringer" 2017-12-11 13:26:29 -08:00
hook_count.go core: Skip diff hooks for stubs on eval altogether 2017-06-24 08:01:17 -07:00
hook_count_action.go
hook_count_test.go core: Skip diff hooks for stubs on eval altogether 2017-06-24 08:01:17 -07:00
hook_state.go Revert "have StateHook periodically PersistState" 2017-06-07 16:25:19 -07:00
hook_state_test.go Revert "have StateHook periodically PersistState" 2017-06-07 16:25:19 -07:00
local_test.go
testing.go command + backend: rename various API objects to "Workspace" terminology 2017-06-09 16:26:25 -07:00