-
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
Users with fixed_count
not being relocated after rebalance
#2091
Comments
@EzR1d3r anything to add? I dont remember but maybe this is a known issue (either way it could be nice to fix) |
@cyberw @andydunstall Hi! It is not known issue. I dont remember rebalance in details right now. Does a master request from workers remained users before rebalancing? Overall, changing self._try_dispatch_fixed to True looks reasonable. And I guess, we need a test for this case, may be in locust/test/test_main.py? |
@EzR1d3r looking at setting Resetting Edit: looking though |
Ok, I`ll see. But anyway I think its better to make separate test with fixed users insted of modify the exising with only weighted. |
Ok sure I'll add another test for fixed users (I assumed to try to avoid duplication as it would be basically the same test again) |
@andydunstall I think your solution is fine. As I remember I didnt add test with fixed_count for rebalacing. You can find my commits for this feature https://github.com/locustio/locust/commits?author=EzR1d3r |
Describe the bug
Running Locust with multiple workers, where
UserA
hasfixed_count = 1
andUserB
has no weight attributes.As expected when starting 4 workers and 8 users, 1
UserA
is started with 7UserB
s. Though when the workerUserA
is running on is terminated, Locust rebalances such that theres now 8UserB
s and noUserA
s. The same issue seems sometimes occur when just scaling up the number of workers, triggering a rebalance.Adding some logs to the code, looks like
self._try_dispatch_fixed
isFalse
on the rebalance (dispatch.py#L387) - which is only set toTrue
when it first runs or when the number of users is reduced.I'm happy have a go at fixing this - though adding issue for visibility.
Steps to reproduce
UserA
as expectedUserB
s as expectedUserA
UserB
s and noUserA
sUserA
sEnvironment
python:3.9
containermaster
/usr/local/bin/python /usr/local/bin/locust --master --locustfile .../locustfile.py
The text was updated successfully, but these errors were encountered: