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

Fix slow shutdown for the Grafana container #5746

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Feb 21, 2023

The root process of the container is /bin/sh, which ignores the initial SIGTERM that Docker sends. So Docker has to wait 10 seconds and then kill everything with SIGKILL.

Make Grafana itself the root process instead. Grafana handles the SIGTERM and shuts down quickly.

Motivation and context

It takes 10 seconds to shut down Grafana without this change, and less than 1 with it.

How has this been tested?

docker compose down

Checklist

  • I submit my changes into the develop branch
  • [ ] I have added a description of my changes into the CHANGELOG file
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

The root process of the container is `/bin/sh`, which ignores the initial
`SIGTERM` that Docker sends. So Docker has to wait 10 seconds and then kill
everything with `SIGKILL`.

Make Grafana itself the root process instead. Grafana handles the `SIGTERM`
and shuts down quickly.
@SpecLad SpecLad requested a review from azhavoro as a code owner February 21, 2023 14:04
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nmanovic nmanovic merged commit 40931e7 into cvat-ai:develop Feb 21, 2023
@SpecLad SpecLad deleted the grafana-shutdown branch March 16, 2023 17:57
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
The root process of the container is `/bin/sh`, which ignores the
initial `SIGTERM` that Docker sends. So Docker has to wait 10 seconds
and then kill everything with `SIGKILL`.

Make Grafana itself the root process instead. Grafana handles the
`SIGTERM` and shuts down quickly.
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 this pull request may close these issues.

2 participants