Marking a thread to ensure no new traffic is routed to the thread
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
I am running my nodejs app using pm2 in cluster mode. My requirement for pm2:
- mark a thread so that the load balancer doesn't route new requests to that thread but keep it running to finish any pending processes
- waits for x seconds
- reloads that thread
- moves to next thread in cluster and repeat.
The idea is to keep it running but not stop. Stopping will terminate any on going process in it.
By waiting for x seconds before reloading we allow it to finish any pending processes.
This approach also ensures we have to make no changes in the code.
Is it possible to create a node script which handles the requirements? It seems like a basic use case.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by reviewing PM2's cluster-mode and reload behavior, then trace the existing process-management commands to determine whether a worker can be drained before reload. Done means the requested per-thread sequence is supported without application code changes and is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100