-
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
generator already executing #2141
Comments
Need more details |
Able to reproduce. EnvironmentOS: Artix Linux x64 Steps
After the launch of the last worker the test starts without problems, but master prints this out before the first status report:
Master command: locust ActivityList \
--headless \
--autostart \
--autoquit 0 \
--run-time 2m \
--users 100 \
--spawn-rate 5 \
--csv (date -Iminutes) \
--csv-full-history \
--html (date -Iminutes) \
--master \
--expect-workers 8 Worker commands: locust --worker --master-host localhost &
locust --worker --master-host localhost &
locust --worker --master-host localhost &
locust --worker --master-host localhost &
locust --worker --master-host localhost &
locust --worker --master-host localhost &
locust --worker --master-host localhost &
locust --worker --master-host localhost & locustfile: from locust import FastHttpUser
from locust import constant_throughput
from locust import task
class ActivityList(FastHttpUser):
wait_time = constant_throughput(1)
@task
def task(self):
self.client.get("http://example.org") |
Interesting. Can you reduce this to a minimum example? Are the extra parameters (particularly autostart, csv) important, for example? |
The most minimal example I was able to construct:
import locust
class User(locust.HttpUser):
host = "http://example.org"
@locust.task
def task(self):
self.client.get("") Worker: locust --worker --master-host localhost Master: locust --master --headless --autostart --users 3 --spawn-rate 1
Offtopic: if |
So passing —autostart AND —autostart is necessary to reproduce the error? Then at least a workaround is easy, because Headless also implies autoquit, because it doesnt make any sense at to keep a non-ui process running longer than the test run. Headless has existed for many years. Autostart is only relevant for UI runs, and it is a very new option, in case you are interested in the history :) |
Yeah, but I would have expected
Aaah, makes sense, thanks for the explanation. |
I agree, it is still a bug. I can take a look at it some time… |
Describe the bug
022-07-26 18:51:06,429 | locust.runners | CRITICAL| Unhandled exception in greenlet: <Greenlet at 0x7fa78408ee60: <bound method MasterRunner.heartbeat_worker of <locust.runners.MasterRunner object at 0x7fa7969cf910>>>
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
File "/usr/local/lib/python3.10/site-packages/locust/runners.py", line 946, in heartbeat_worker
self.start(user_count=self.target_user_count, spawn_rate=self.spawn_rate)
File "/usr/local/lib/python3.10/site-packages/locust/runners.py", line 757, in start
for dispatched_users in self._users_dispatcher:
File "/usr/local/lib/python3.10/site-packages/locust/dispatch.py", line 114, in next
users_on_workers = next(self._dispatcher_generator)
ValueError: generator already executing
Expected behavior
No exception
Actual behavior
Test dies
Steps to reproduce
Running distributed
022-07-26 18:33:52,156 | workload | INFO | Test Requested: Stepped
2022-07-26 18:33:52,156 | workload | INFO | Total Users: 1500
2022-07-26 18:33:52,156 | workload | INFO | Test Duration: 900.0
2022-07-26 18:33:52,156 | workload | INFO | Step Duration: 12.0
2022-07-26 18:33:52,156 | workload | INFO | Users per Step: 30
2022-07-26 18:33:52,156 | workload | INFO | User Spawn Rate: 2.5
2022-07-26 18:33:52,233 | locust.main | INFO | Starting web interface at http://0.0.0.0:8089 (accepting connections from all network interfaces)
2022-07-26 18:33:52,247 | locust.main | INFO | Starting Locust 2.10.1
2022-07-26 18:48:40,998 | workload | INFO | Test Requested: step_tick - User Count (30, 2.5)
2022-07-26 18:48:52,315 | workload | INFO | Test Requested: step_tick - User Count (30, 2.5)
2022-07-26 18:48:53,316 | workload | INFO | Test Requested: step_tick - User Count (60, 2.5)
2022-07-26 18:49:04,619 | workload | INFO | Test Requested: step_tick - User Count (60, 2.5)
2022-07-26 18:49:05,620 | workload | INFO | Test Requested: step_tick - User Count (90, 2.5)
2022-07-26 18:49:16,963 | workload | INFO | Test Requested: step_tick - User Count (90, 2.5)
2022-07-26 18:49:17,964 | workload | INFO | Test Requested: step_tick - User Count (120, 2.5)
2022-07-26 18:49:29,275 | workload | INFO | Test Requested: step_tick - User Count (150, 2.5)
2022-07-26 18:49:40,586 | workload | INFO | Test Requested: step_tick - User Count (150, 2.5)
2022-07-26 18:49:41,587 | workload | INFO | Test Requested: step_tick - User Count (180, 2.5)
2022-07-26 18:49:52,908 | workload | INFO | Test Requested: step_tick - User Count (180, 2.5)
2022-07-26 18:49:53,909 | workload | INFO | Test Requested: step_tick - User Count (210, 2.5)
2022-07-26 18:50:05,215 | workload | INFO | Test Requested: step_tick - User Count (240, 2.5)
2022-07-26 18:50:16,521 | workload | INFO | Test Requested: step_tick - User Count (240, 2.5)
2022-07-26 18:50:17,523 | workload | INFO | Test Requested: step_tick - User Count (270, 2.5)
2022-07-26 18:50:28,830 | workload | INFO | Test Requested: step_tick - User Count (270, 2.5)
2022-07-26 18:50:29,831 | workload | INFO | Test Requested: step_tick - User Count (300, 2.5)
2022-07-26 18:50:41,132 | workload | INFO | Test Requested: step_tick - User Count (330, 2.5)
2022-07-26 18:50:52,424 | workload | INFO | Test Requested: step_tick - User Count (330, 2.5)
2022-07-26 18:50:53,425 | workload | INFO | Test Requested: step_tick - User Count (360, 2.5)
2022-07-26 18:51:05,652 | workload | INFO | Test Requested: step_tick - User Count (390, 2.5)
2022-07-26 18:51:06,429 | locust.runners | CRITICAL| Unhandled exception in greenlet: <Greenlet at 0x7fa78408ee60: <bound method MasterRunner.heartbeat_worker of <locust.runners.MasterRunner object at 0x7fa7969cf910>>>
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
File "/usr/local/lib/python3.10/site-packages/locust/runners.py", line 946, in heartbeat_worker
self.start(user_count=self.target_user_count, spawn_rate=self.spawn_rate)
File "/usr/local/lib/python3.10/site-packages/locust/runners.py", line 757, in start
for dispatched_users in self._users_dispatcher:
File "/usr/local/lib/python3.10/site-packages/locust/dispatch.py", line 114, in next
users_on_workers = next(self._dispatcher_generator)
ValueError: generator already executing
2022-0
Environment
The text was updated successfully, but these errors were encountered: