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

graphql-engine v2 container image reacts to SIGTERM to avoid SIGKILL #10284

Open
almereyda opened this issue Jun 9, 2024 · 0 comments
Open
Labels
k/enhancement New feature or improve an existing feature

Comments

@almereyda
Copy link

Is your proposal related to a problem?

When stopping a container that is based on hasura/graphql-engine it takes 10 seconds, until the container scheduler issues SIGKILL.

Reacting to SIGTERM would allow to shut down the process gracefully.

Describe the solution you'd like

The process launched by the image built from https://github.com/hasura/graphql-engine/blob/master/packaging/graphql-engine/Dockerfile reacts to SIGTERM signals.

This could be achieved by providing the tini binary in the container image and using that to launch the entrypoint command.

Describe alternatives you've considered

Users of the container can always use the --init flag of the run command to wrap tini around the entrypoint.

This is also available for Docker Compose when providing the init: true property to services.

In case this behaviour is preferred, it should be documented.

Example:

After launching the containers once without and once with the init flag, the shutdown times differ greatly:

$ docker compose stop 
[+] Stopping 1/1
 ✔ Container hasura-console-1  Stopped                         10.2s 

The need for using an init process to catch signals is visible by a shutdown time of almost exactly 10 seconds.

$ docker compose stop 
[+] Stopping 1/1
 ✔ Container hasura-console-1  Stopped                          0.2s 

It's either the init workaround with tini, that should be documented, or explicit signal handling in the graphql-engine binary which could help alleviate the situation.

@almereyda almereyda added the k/enhancement New feature or improve an existing feature label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant