Closed skyrpex closed 3 months ago
@eladb @Chriscbr I have a problem. I'm trying to implement the new statuses of resources: starting, error, stopping, started, stopped. But see the following example:
bring sim;
new sim.Resource(inflight (ctx) => {
throw "oops";
}) as "MyResource";
The "oops" error is logged after MyResource
is successfully started, and there's no way for me to infer that it really was an initialization error afterwards.
I'm currently trying to figure out if I can change how this works and run these initialization inflights before marking a resource as "started", but may need a hand.
I think we need to update the simulator so when it's initializing resources, if any resource fails to start, we should stop all resources that were started instead of continuing to initialize other resources. (It seems like I'm able to find some examples where this doesn't happen) @eladb WDYT?
I wouldn't stop all resources but any resources that depend on resources that failed to initialize.
It'd be beneficial to allow interacting with whatever is working from the app IMO, and also to detect more than one problem in different unrelated resources, too.
I am with Chris. Let's keep this transactional and simple.
I am not sure I see much value in interacting with an app that didn't fully initialize properly.
(For example, in CloudFormation if an update fails, it reverts back all the updated resources)
Fair enough, will do it tha way 👍🏻
Congrats! :rocket: This was released in Wing 0.75.8.
The intent of this change is to improve the Console diagnostics when a construct fails to initialize during inflight.
Also, the simulator should emit these events for every resource:
Proposal: #6593.