Skip to content

SIGTERM is not handled: docker stop kills the node without a graceful shutdown #784

Open

Description

@unbalancedparentheses

Summary

The node only handles SIGINT. SIGTERM, which docker stop (and systemd, Kubernetes) send, has no handler, so the process is killed immediately with no graceful shutdown: no Shutdown signal received, actors and servers are not stopped, nothing is flushed.

Evidence

  • bin/ethlambda/src/main.rs:988 (and 994, 998, 1002, 1131) only await tokio::signal::ctrl_c().
  • Mainnet beacon follower, main at c3f5f56, after warm-up: SIGTERM ×3 → exit code 143 in ~0.1 s, no shutdown log lines. SIGINT ×4 → exit 0 in 52 ms - 1.27 s.
  • Lean devnet node from genesis: SIGTERM → exit 143 as well.
  • The README works around it with --stop-signal SIGINT.

Suggested fix

Treat SIGTERM like SIGINT (e.g. tokio::signal::unix::signal(SignalKind::terminate()) selected together with ctrl_c()). The spawned v0.7 adoption PR #783 does this as part of a larger change (SIGTERM shuts down cleanly in 93-102 ms on mainnet), but a small standalone fix could land first.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions