-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 support for graceful shutdown of OPA server #1291
Comments
We've had users request better support for graceful shutdown of the OPA server deployed in the Kubernetes admission control use case. What I think we would be good is to extend OPA with a command line flag that lets users set the graceful shutdown period, e.g., |
Can do. One clarification, we want to let active connections finish and stop accepting new ones? Or allow new ones in the grace period too? |
I think it's OK to accept new connections during the shutdown period for now. In k8s, the endpoint will get removed, so the OPA should stop receiving new requests. We can revisit in the future as needed. |
There is a new CLI option to configure the grace period: `--shutdown-grace-period` The option defaults to 10 seconds. When a SIGINT or SIGTERM is sent the runtime will catch them and attempt to gracefully shutdown the http servers. If the timeout is reached it will log an error and continue with exiting (in a less graceful way). Unit testing is a little bit light on this. Its touching some parts of the code that aren't super easy to mock out. We can probably refactor things in the future to make it easier. Fixes: open-policy-agent#1291 Signed-off-by: Patrick East <east.patrick@gmail.com>
There is a new CLI option to configure the grace period: `--shutdown-grace-period` The option defaults to 10 seconds. When a SIGINT or SIGTERM is sent the runtime will catch them and attempt to gracefully shutdown the http servers. If the timeout is reached it will log an error and continue with exiting (in a less graceful way). Unit testing is a little bit light on this. Its touching some parts of the code that aren't super easy to mock out. We can probably refactor things in the future to make it easier. Fixes: #1291 Signed-off-by: Patrick East <east.patrick@gmail.com>
OPA should wait for active connection to gracefully handled and then shutdown.
The text was updated successfully, but these errors were encountered: