Skip to content
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

Enhance PM2 Process Management with Error Handling and Graceful Shutdown #30

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

rickybharti
Copy link

Description

This update enhances PM2 process management script by:

  • Adding input validation for count.
  • Implementing retries for failed process starts.
  • Handling graceful shutdown with SIGINT.

Key Changes

  • Validates count as a positive integer.
  • Starts processes with retry logic on failure.
  • Tracks started and failed processes, exiting appropriately.
  • Ensures PM2 disconnects gracefully on SIGINT.

Testing

  • Validated various count inputs.
  • Tested process start failures and retries.
  • Simulated graceful shutdown with SIGINT.

Note: SIGINT hasn't been tested extensively. Please try to test it thoroughly before approving. (@soniasingla)
Please review and provide feedback.

@soniasingla
Copy link
Contributor

@rickybharti thanks for your PR, amazing work 🤗 I am working on reviewing it and will get back to you :)

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.

2 participants