-
Notifications
You must be signed in to change notification settings - Fork 3k
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
modified check_stopped condition #1769
Conversation
added STATE_INIT to condition in check_stopped condition for clients - it looks like there's possibility that master is not in STATE_INIT anymore, but some client didn't have enough time to change the state
From what I tested - this seems to be fixing #1762 |
thx! |
@stanislawskwark @cyberw, when I merged this change into #1621, one of the tests began to fail because the assertion checking if the master's state is I also observed the behavior when a distributed load test is stopped (i.e. I investigated and found that the master stays
Is this intentional? |
Intention was not too stop the master right at the beginning of test, when some workers didn't have enough time to switch from init to spawning. Should workers really reconnect and be in init state? If so then this will indeed break stopping, I'm wondering though, wouldn't it make more sense if stopped workers stayed in stopped status without disconnecting? I would really like to avoid reverting this change because it fixes serious issue. Without it tests were unpredictable and restarting whole test, building environments and so on using 80 or more workers takes a lot of time. Unless there's some other solution for this problem |
How about the master keeps track of when a test was started and use this in the Something like: def check_stopped(self):
if (
time.time() - self.started_at > int(os.getenv("STARTED_AT_THRESHOLD", 10))
and self.state not in [STATE_INIT, STATE_STOPPED]
and all(map(lambda x: x.state not in (STATE_RUNNING, STATE_SPAWNING), self.clients.all))
):
self.update_state(STATE_STOPPED) By making it configurable via an environment variable, it would be possible to accommodate different load test scale such as yours with lots of workers. |
This fixes the issue of the master staying in the "stopping" state in certain situations. The issue was introduced by locustio#1769.
curious if this will be released soon |
Yes, 1.6.0 should be out in a minute or two! |
added STATE_INIT to condition in check_stopped condition for clients - it looks like there's possibility that master is not in STATE_INIT anymore, but some client didn't have enough time to change the state