openfaas / templates

OpenFaaS Classic templates
https://www.openfaas.com
MIT License
276 stars 228 forks source link

Graceful Shutdown for template node18 functions #305

Open NikhilSharmaWe opened 1 year ago

NikhilSharmaWe commented 1 year ago

Expected Behaviour

When a function receives a SIGTERM signal the function should first handle the current ongoing requests before terminating the function.

Current Behaviour

Currently, when a function receives a SIGTERM signal, the function immediately terminates.

Are you a GitHub Sponsor (Yes/No?)

Check at: https://github.com/sponsors/openfaas

Which Solution Do You Recommend?

Handle the condition when a function recieves a SIGTERM signal. Wait for some graceful period before terminating if the function have an ongoing request, otherwise terminate without waiting.