[PR #1321] [MERGED] Improve shutdown behavior (on kubernetes and allow CTRL+C) #2943

Closed
opened 2026-03-03 09:09:02 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/1321
Author: @mkilchhofer
Created: 1/22/2021
Status: Merged
Merged: 1/24/2021
Merged by: @dani-garcia

Base: masterHead: feature/improve_shutdown_behavior


📝 Commits (1)

  • 1e31043 Improve shutdown behavior (on kubernetes)

📊 Changes

7 files changed (+16 additions, -15 deletions)

View changed files

📝 docker/Dockerfile.j2 (+3 -7)
📝 docker/amd64/Dockerfile (+2 -1)
📝 docker/amd64/Dockerfile.alpine (+2 -1)
📝 docker/arm64/Dockerfile (+2 -1)
📝 docker/armv6/Dockerfile (+2 -1)
📝 docker/armv7/Dockerfile (+2 -1)
📝 docker/armv7/Dockerfile.alpine (+3 -3)

📄 Description

Description of the change

@mfriedenhagen pointed at an init process in this issue here: https://github.com/dani-garcia/bitwarden_rs/issues/905#issuecomment-753454442
First I thought that this would not help, since Rocket does not explicitly handly any signal sent to it. But it seems that adding an init process like dumb-init still improves the shutdown behavior. According to the documentation of dumb-init this might be the reason why:

The Linux kernel applies special signal handling to processes which run as PID 1.

Benefits

Especially running bitwarden inside kubernetes resulted, that evicting a node which runs bitwarden takes a long time becase we need to wait until kublet kills bitwarden hardly. With this improvement, the container terminates as fast as all other workload.

Possible drawbacks

No known drawbacks

Applicable issues


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/1321 **Author:** [@mkilchhofer](https://github.com/mkilchhofer) **Created:** 1/22/2021 **Status:** ✅ Merged **Merged:** 1/24/2021 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `feature/improve_shutdown_behavior` --- ### 📝 Commits (1) - [`1e31043`](https://github.com/dani-garcia/vaultwarden/commit/1e31043fb3c180c6ce8183d027677d1b9dbe0bf3) Improve shutdown behavior (on kubernetes) ### 📊 Changes **7 files changed** (+16 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `docker/Dockerfile.j2` (+3 -7) 📝 `docker/amd64/Dockerfile` (+2 -1) 📝 `docker/amd64/Dockerfile.alpine` (+2 -1) 📝 `docker/arm64/Dockerfile` (+2 -1) 📝 `docker/armv6/Dockerfile` (+2 -1) 📝 `docker/armv7/Dockerfile` (+2 -1) 📝 `docker/armv7/Dockerfile.alpine` (+3 -3) </details> ### 📄 Description **Description of the change** @mfriedenhagen pointed at an init process in this issue here: https://github.com/dani-garcia/bitwarden_rs/issues/905#issuecomment-753454442 First I thought that this would not help, since Rocket does not explicitly handly any signal sent to it. But it seems that adding an init process like `dumb-init` still improves the shutdown behavior. According to the [documentation](https://github.com/Yelp/dumb-init/blob/master/README.md) of dumb-init this might be the reason why: > The Linux kernel applies special signal handling to processes which run as PID 1. **Benefits** Especially running bitwarden inside kubernetes resulted, that evicting a node which runs bitwarden takes a long time becase we need to wait until kublet kills bitwarden hardly. With this improvement, the container terminates as fast as all other workload. **Possible drawbacks** No known drawbacks **Applicable issues** - #905 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:09:02 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#2943
No description provided.