Report snapshot write errors as actual errors #16090
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we finish an operation and close the snapshot manager, the snapshot manager may perform a final write if there are unflushed changes (e.g. refresh changes whose writes were elided at the time). Things may go wrong at this point -- if something is wrong with the snapshot, the integrity check following this write could fail; if a write error occurs, pieces of the snapshot may be missing. In these cases, we really don't want to swallow the error or report it as "just" a diagnostic, because it's a real problem that will almost certainly rear its head on the next Pulumi invocation when we attempt (and fail) to read the snapshot (or worse, operate with an incomplete one). This commit changes the existing flow to report all snapshot close errors as bonafide failures, even if the actual operation has succeeded and been applied.