Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add check to multiprocess supervisor #641
Conversation
…tdown in case of max_limit_requests hit
| self.shutdown() | ||
|
|
||
| def workers_alive(self): |
rafalp
May 9, 2020
Member
Is it possible for this function to return negative number, eg. when old processes haven't finished shutdown but new ones have already spawned?
Is it possible for this function to return negative number, eg. when old processes haven't finished shutdown but new ones have already spawned?
euri10
May 9, 2020
Author
Contributor
I dont see a situation where it could happen, the max number of workers is the one when it's initialized and set to self.workers_number, after that it can only decrease,
for this number to be negative there would be the need for new workers to be spawned, but in our case it only happens once at start, if it dies it dies
I dont see a situation where it could happen, the max number of workers is the one when it's initialized and set to self.workers_number, after that it can only decrease,
for this number to be negative there would be the need for new workers to be spawned, but in our case it only happens once at start, if it dies it dies
| @@ -16,13 +16,14 @@ | |||
|
|
|||
|
|
|||
| class Multiprocess: | |||
| def __init__(self, config, target, sockets): | |||
| def __init__(self, config, target, sockets, workers_number): | |||
tomchristie
May 11, 2020
Member
It doesn't look like we should need workers_number here.
In startup we're using self.config.workers - can we not rely on that instead? (Or am I missing something?)
It doesn't look like we should need workers_number here.
In startup we're using self.config.workers - can we not rely on that instead? (Or am I missing something?)
should solve #632
it adds a check to see if workers are still alive (limit_max_request will kill them) annd in that case it sets the should_exit event thread