Skip to content

[Bug] Backend doesn't handle SIGTERM gracefully causing data loss #757

Description

@Dev-AdeTutu

Describe the Bug

When Docker/K8s sends SIGTERM to backend, process exits immediately without finishing in-flight requests or closing database connections, causing usage event data loss.

Steps to Reproduce

  1. Start backend with active MQTT message processing
  2. Send SIGTERM: docker stop container
  3. Process exits immediately
  4. In-flight usage updates lost
  5. Database connections not closed properly

Expected Behavior

Implement graceful shutdown:

  • Stop accepting new requests
  • Finish processing in-flight requests (max 30s)
  • Close MQTT connection
  • Close database connections
  • Exit with code 0

Actual Behavior

Immediate exit, potential data loss.

Environment

Field Value
Component backend
OS Ubuntu 22.04 (Docker)
Network testnet

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendbugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions