bug: Server container does not handle SIGTERM gracefully #72
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#110
Original Author: @icub3d
Original Date: 2026-04-23T18:04:45Z
Bug: Server container does not handle SIGTERM gracefully
Overview
The
decentcom-serverDocker container does not respond toSIGTERMsignals, causingdocker stopto hang for 10 seconds before forcefully killing the process withSIGKILL. This prevents graceful shutdown of the database and other resources.Background
In Docker, the process started by the
ENTRYPOINTruns as PID 1. Standard Linux signals likeSIGTERMare not handled by default in PID 1 unless the application explicitly traps them or an init process liketiniis used to proxy signals. This was observed during the verification of PR #109.Requirements
SIGTERM.docker stopshould complete quickly (well under the 10-second default timeout).Design
API / Interface Changes
None.
Data Model Changes
None.
Component Changes
server/src/main.rs: May need to add signal handling logic.Dockerfile: May need to be updated to includetinior equivalent.Task List
server/src/main.rs.tiniin the Dockerfile.docker stop.Test List
docker run -d --name shutdown-test decentcom-server.time docker stop shutdown-test.docker stopcompletes in < 2 seconds.Open Questions
tini(easier and handles zombie processes)?