SIGTERM is unhandled, so every managed restart is a hard kill

Open Beginner friendly
#172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust
Domain
backend

Research direction

Start in rs/cyphr-server/src/lib.rs, reading the serve doc comment and the shutdown_signal() implementation. Reproduce the difference between SIGINT and SIGTERM, then verify that SIGTERM produces the draining and stopped log messages and no longer hard-kills the server with connections in flight.

Written by the indexing model from the issue text.

Description

bug

The server does not handle SIGTERM, so every managed restart is a hard kill with connections in flight.

serve's own doc comment in rs/cyphr-server/src/lib.rs says it "blocks until SIGTERM/SIGINT". shutdown_signal() awaits tokio::signal::ctrl_c() only, which is SIGINT. SIGTERM — what systemd, Docker, Kubernetes and a bare kill all send by default — is unhandled, so the process dies on the default disposition without draining.

Reproduction

Send SIGINT:

shutdown signal received, draining connections
server stopped

Send SIGTERM: neither line appears. The last entry in the log is server started.

Impact

The store survives — restarting after a SIGTERM kill opens cleanly with no stale lock — so the damage is bounded to requests in flight. But that is every systemctl restart, every container stop, and every rolling deployment.

The doc comment claiming both signals makes it worse: an operator reading the source concludes draining is handled.

Dominant language
Rust
Stars
3
Forks
0
Avg merge
1d 42m
Merged PRs (30d)
11

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Cyphrme/Cyphr

All issues in Cyphrme/Cyphr

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.