0

I have set the timeout in func.yaml to 300 seconds (5 minutes) but the function only runs for 2 minutes and then terminates with error code 502.

Error invoking function. status: 502 message: error receiving function response

There is a github issue that discusses this problem: https://github.com/fnproject/fn/issues/723

How do I resolve this problem?

Edit:

As an example, I created a nodejs function which should respond after 270 seconds but doesn't due to early timeout.

fdk.handle(function(input){
    return new Promise((resolve,reject)=>{
        setTimeout(()=>resolve("Hello"),270000);
    });
})
Nakash Kumar
  • 60
  • 1
  • 7
  • What is error code 502? What response does your function generate? Show us your code. – Martin Feb 06 '21 at 19:14
  • 1
    It arises when the server is waiting for function response and doesn't get it in time. When I calculate the function time (using time utility e.g. time fn invoke...), it always terminates at 2m0.751s as apparently it is the actual function timeout. – Nakash Kumar Feb 06 '21 at 19:21

0 Answers0