Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] Graceful shutdown best practices documentation request #866

Open
SimonLuckenuik opened this issue Jun 27, 2018 · 8 comments

Comments

@SimonLuckenuik
Copy link

SimonLuckenuik commented Jun 27, 2018

Hi,

I am looking for best practices on handling gracefully scale downs/shutdowns. I am also looking for Function App code deployment organization recommendations to help minimizing impact on shutdown scenarios.

While I found information here and there, scattered around in Github repos and docs.com, I was not able to find a nice summary or reference/guide on the subject that provide best practices.
Some questions to understand what I am looking for :

  1. What happen when a scale down occurs and a Function is currently executing on the node being stopped because of scaledown? Is the cancellation token still approach applicable?

  2. Is the scale controller aware of currently executing Functions to prevent tear down of currently executing Function?

  3. What happen when stopping an Azure Function app while a function is executing? How can I know this is happening, using the cancellation token approach? Is it the same behavior when upgrading the Functions runtime?

  4. What is the behavior of Azure Functions when reaching the execution timeout? Reference. Is the Cancellation Token approach still applicable for execution timeout?

Thanks!

Related issue: #862

@ColbyTresness
Copy link

@ColbyTresness ColbyTresness added this to the Active Questions milestone Mar 13, 2019
@therealvegeta
Copy link

Bump, curious myself.

@SimonLuckenuik
Copy link
Author

Bump, this is an important topic that should be addressed.

@ggailey777
Copy link
Contributor

Link to the work item in the internal content tracking database: 1636645

@noakesey
Copy link

noakesey commented Dec 9, 2019

I would like to know how this works under the covers and how we are expected to handle it. I can't seem to find any relevant documentation (Dec 2019) that explains such an important concept. Consumption plan scale down may well explain why we see duplicate message processing?

@SimonLuckenuik
Copy link
Author

SimonLuckenuik commented Dec 12, 2019

@jeffhollan This issue has been opened for 18 months and this concept is very important and has high impact (complete process shutting down). Is there a public timeline available for this documentation or at least an informal documentation? We do hit the limit from time to time and it has high impact. We do not want to switch to Premium plan and have unlimited execution time, we just want to prevent that reaching the maximum timeout that kills the complete app in Consumption plan.

@gkindov
Copy link

gkindov commented Dec 10, 2020

Hi, is there an function app level host shutdown event I can intercept so I can clean app static resources used but the whole app? I can't find anything in the doc, only Startup.

@sgalles
Copy link

sgalles commented Jul 25, 2021

I found out about this issue totally by chance working on performances issues and timeouts on Java functions. On one hand I technically understand why killing the whole JVM is necessary after a timeout (threads can't be killed), on the other hand this is a very important behavior that should be documented because as a user of Azure Functions I certainly won't chose timeout values the same way when I have this information. So yes, please, a the very least put one line about this in the documentation (I couldn't find anything about it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants