add graceful shutdown for node18 functions#306
Conversation
|
This looks very similar to what I was excepting. I think you'll need to test it and also need to wait for the health check duration before calling close on the server. See how we do that in the Go template. |
13eba1c to
7508b33
Compare
Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>
7508b33 to
8af6cd5
Compare
|
I've sent you a trial license for OpenFaaS Pro/Standard. Would you like to try testing it with a 10min shutdown time? Installation -> https://docs.openfaas.com/deployment/pro/ Testing with long timeouts -> https://www.openfaas.com/blog/long-running-jobs/ I simulate it like this: Deploy function... invoke it and watch the logs. (with a 10m sleep) Then I update the code and image tag, and redeploy it. If it's all working right, the Pod should go to Terminating but stay around until the invocation has completed successfully. Here's my test function for Go/Python/Node for a longer timeout if you need it - https://github.com/alexellis/go-long |
|
I test the update node18 template for Then the logs for the node18 func after |
|
Thanks for working on this and for testing the change. What I'd like to see is a curl statement - followed by you scaling to zero replicas. Show that "time curl ..." completes despite you scaling down. You'll need the Pro/Standard license that I sent you separately. |
Description
This PR adds graceful shutdown for template
node18functions.Motivation and Context
Which issue(s) this PR fixes
Fixes #305
How Has This Been Tested?
SIGTERM, like :kubectl -n openfaas-fn exec testdrainfunc-b44d49bb6-9kzzh -- kill -s SIGTERM 1.Types of changes
Impact to existing users
There will be no significant impact on how users use openfaas functions.
Checklist:
git commit -s