pulumi/pkg
bors[bot] 3707c920d5
Merge #11185
11185: [auto] Fix hangs for remote previews r=justinvp a=justinvp

Retrieving engine events programmatically through automation api would result in the operation seemingly hanging for remote operations. This was particularly noticeable during remote previews, because preview in automation API programmatically inspects engine events to look for the summary event (which it doesn't do for up/refresh/destroy).

The problem is due to the lack of a terminating `CancelEvent`. Normally, for local operations, the event stream is always terminated by a `CancelEvent` which is the sentinel value used to indicate the operation is complete. However, when sending events to the service, the `CancelEvent` is not sent. So when we're retrieving events from the service for a remote operation, we weren't getting back a `CancelEvent`.

The fix is to send a synthesized `CancelEvent` to the events channel after all the events have been read from the service ([similar to what is done by the `pulumi replay-events` hidden debug command](7694cffb6e/pkg/cmd/pulumi/replay_events.go (L180-L184))).

Note: This issue would not happen when running a remote preview via the CLI with the default progress event display, because that display looks for [both `event.Type` of  `engine.CancelEvent` as well as an empty string as terminal events](fb7400507a/pkg/backend/display/progress.go (L1226-L1232)); the latter empty string happens when the events channel is closed).

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2022-10-28 18:39:15 +00:00
..
authhelpers Add support for authentication via GOOGLE_CREDENTIALS (#6379) 2022-06-07 16:02:08 +01:00
backend [auto] Fix hangs for remote previews 2022-10-28 10:33:43 -07:00
cmd/pulumi Merge #11165 2022-10-28 01:05:54 +00:00
codegen Fix failing tests 2022-10-28 10:18:09 -07:00
engine test # This is a combination of 3 commits. 2022-10-25 16:54:58 -07:00
graph Update error handling (#8406) 2021-11-12 18:37:17 -08:00
operations ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
resource Add `pulumi state delete --target-dependents` 2022-10-27 11:23:56 -07:00
secrets Merge #11094 2022-10-24 11:33:21 +00:00
testing/integration Merge #10832 2022-10-18 16:42:18 +00:00
util [cli] Enable single-file Pulumi YAML templates (#10437) 2022-08-18 23:13:56 +01:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod Update dependencies 2022-10-28 09:03:19 +00:00
go.sum Upgrade yaml to v0.5.10 2022-10-13 14:39:25 -07:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.