Hi,
The function node is suppose to timeout and throw interrupted after 5 seconds. However this does not always happen. I have created 2 examples to illustrate it. I purposely use "while (true)" just to simulate that it has a bunch of unoptimised code.
This will throw Error: interrupted
export const handler = async (input) => {
let i = 0;
while (true) {
++i;
}
return input;
};
This does not seem to throw any error after a long time ( > 5 seconds )
export const handler = async (input) => {
while (true) {
console.log("hello")
}
return input;
};
We have another situation where it is not "while (true)" but its a bunch of heavy looping codes. It is not optimised. We are expecting the function to throw interuppted but it didnt which causes the whole flow to "hang" indefinitely.
Hi,
The function node is suppose to timeout and throw
interruptedafter 5 seconds. However this does not always happen. I have created 2 examples to illustrate it. I purposely use "while (true)" just to simulate that it has a bunch of unoptimised code.This will throw
Error: interruptedThis does not seem to throw any error after a long time ( > 5 seconds )
We have another situation where it is not "while (true)" but its a bunch of heavy looping codes. It is not optimised. We are expecting the function to throw interuppted but it didnt which causes the whole flow to "hang" indefinitely.