winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.9k stars 194 forks source link

Console: inconsistent behavior in the simulator #6865

Open skyrpex opened 2 months ago

skyrpex commented 2 months ago

It does seem like there's inconsistent behavior in the simulator -- for example if a resource fails to start, in some cases like the one you showed above, the console keeps working fine / the simulator tries to keep running. But in other examples, the failure of one resource to start will cause a blue screen of death, for example try out this example (I ran it with Wing 0.76.19):

bring cloud;
bring util;
bring sim;

let service1 = new sim.Resource(inflight (ctx) => {
  util.sleep(5s);
  // ctx.resolveToken("foo", "foo");
  throw "Oops";
}) as "Service1";

let t1 = service1.createToken("foo");

let service2 = new sim.Resource(inflight (ctx) => {
  util.sleep(5s);
  throw "Oops";
  log(t1);
}) as "Service2";

new cloud.Bucket();

Originally posted by @Chriscbr in https://github.com/winglang/wing/issues/6858#issuecomment-2214283021

skyrpex commented 1 month ago

Related to #6798