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.97k stars 196 forks source link

Function with infinite loop keeps on spewing logs even after hot reloading a change of code that deletes it #4087

Closed ShaiBer closed 5 months ago

ShaiBer commented 1 year ago

I tried this:

Wrote this code:

bring cloud;
bring util;

new cloud.Function(inflight () => {
  while true {
    log("Weeeeee");
    util.sleep(1s);
  }
});

Then invoked the function and saw the logs starting to appear.

Then I deleted the function, so my code is this:

bring cloud;
bring util;

This happened:

After the console hot reloaded the new code, the Function was removed from the map view, but the "Weeee" logs kept appearing every second

I expected this:

The logs to stop coming in

Is there a workaround?

No response

Component

SDK

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Anything else?

I was doing this test in the playground.

Also, if I changed the sleep time to 1ms the playground crashed after a short time..

Community Notes

github-actions[bot] commented 10 months ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

skyrpex commented 10 months ago

I think this belongs to the simulator.

@Chriscbr

github-actions[bot] commented 7 months ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

Chriscbr commented 5 months ago

This bug has since been fixed (the inflight code now runs in an external process which can be killed - see https://github.com/winglang/wing/pull/5554)