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

How to do graceful shutdown of KERIA #175

Open
lenkan opened this issue Jan 25, 2024 · 2 comments · May be fixed by #337
Open

How to do graceful shutdown of KERIA #175

lenkan opened this issue Jan 25, 2024 · 2 comments · May be fixed by #337

Comments

@lenkan
Copy link
Collaborator

lenkan commented Jan 25, 2024

Currently, it seems like KERIA does not handle SIGTERM signals. Most container runtimes would send a SIGTERM signal, followed by a timeout of X seconds/minutes and then send a SIGKILL, which will not allow KERIA to gracefully shutdown.

Are there another recommended way to shutdown a KERIA instance? If not, I suggest to implement a SIGTERM listener that ensures we stop receiving new HTTP requests, then shutting down all the doers, allowing for the process to stop gracefully.

More urgently, do you see any potential issues with sending SIGKILL and killing the process immediately?

Any other thoughts on this?

One way to try this out is to use the docker-compose environment in signify-ts repo.

docker compose up keria
docker compose kill -s SIGTERM

Notice that keria does not shut down on its own. Then do:

docker compose kill -s SIGKILL

Keria then shuts down immediately.

@kentbull
Copy link
Contributor

kentbull commented Feb 2, 2024

I would think there's a way to create a Doer in the HIO framework that HIO could process to close out the event loop. I suspect this will be a feature request to the HIO package. I will look through the source code there to see what I can find that would work as a shutdown signal.

I could see this being a Doer that listens for the SIGTERM signal and then instructing the core event loop to stop accepting new requests and to close down.

@2byrds
Copy link
Collaborator

2byrds commented Apr 25, 2024

From the keri dev meeting:
Kent is working on this!

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

Successfully merging a pull request may close this issue.

3 participants