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

Graceful shutdown when using the Python worker #1521

Open
bastbu opened this issue Jul 1, 2024 · 0 comments
Open

Graceful shutdown when using the Python worker #1521

bastbu opened this issue Jul 1, 2024 · 0 comments

Comments

@bastbu
Copy link

bastbu commented Jul 1, 2024

Is your question related to a specific version? If so, please specify:

The question is not related to a specific version.

What binding does your question apply to, if any? (e.g. Blob Trigger, Event Hub Binding, etc)

HTTP trigger

Question

The best practices for Azure Functions mention that we should reuse global client instances for better performance with connection pooling. One example also demonstrates the use of a global Cosmos client instance as a pattern.

However, with these global instances, there should be a way to close the connections on a graceful shutdown, prior to stopping the worker.

Another use-case would be to make sure that all telemetry is flushed before the host is (gracefully) shutting down.

Is there any existing documentation that I missed which would explain how to do this in Python? If not, could you provide guidance on how this should be implemented?

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

1 participant