Skip to content

feat: Reuse existing function to implement graceful shutdown logic #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dilnawaz-khan-ops
Copy link

@Dilnawaz-khan-ops Dilnawaz-khan-ops commented Jul 16, 2025

Summary

Improves signal handling by reusing the existing InterruptContext() function and extending it to handle SIGTERM. This is useful for containers like ECS Fargate which terminate using SIGTERM.

Changes Introduced.

  • Listens for syscall.SIGTERM in addition to os.Interrupt
  • Logs signal received and when graceful shutdown is complete

Why This Matters

Without this, containers might be force-killed before completing cleanup logic. This update ensures the app exits gracefully when the platform sends a termination signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant