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

Add a shutdown API to enable graceful termination of AnyVar #66

Closed
ehclark opened this issue Dec 12, 2023 · 1 comment · Fixed by #76
Closed

Add a shutdown API to enable graceful termination of AnyVar #66

ehclark opened this issue Dec 12, 2023 · 1 comment · Fixed by #76
Assignees
Labels
enhancement New feature or request

Comments

@ehclark
Copy link
Contributor

ehclark commented Dec 12, 2023

The Snowflake storage backend writes VRS object batches asynchronously. Untimely termination could therefore result in pending batches being discarded. Providing an API for graceful shutdown would allow for all pending batches to be written prior to termination. This API should be callable as a PreStop hook in Kubernetes: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/

See also #64

@ehclark ehclark added the enhancement New feature or request label Dec 12, 2023
@ehclark ehclark self-assigned this Dec 12, 2023
@ehclark
Copy link
Contributor Author

ehclark commented Jan 10, 2024

Given the process model used by ASGI, it would be improper to place a shutdown API in the app itself. Startup/shutdown is the responsibility of the web server, such as uvicorn or gunicorn.

Instead, AnyVar app should perform a graceful shutdown of the storage integration when a shutdown is occurs. This can be implemented by lifespan events, which are already in use for startup.

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

Successfully merging a pull request may close this issue.

1 participant