-
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
curl IP/stop does not actually terminate Locust swarms #1661
Comments
Interesting. It is possible that this issue arose from making the stopping of user greenlets async a while back. I think the best way to fix this is to stop the spawning greenlet from runner.stop() before actually stopping user greenlets. Do you agree @heyman ? |
I don't have that code fresh in my head (and at the moment don't have time to start digging), but that sounds reasonable to me @cyberw We should be able to write a test for this I think. |
I'll have a look some time soon. |
From my understanding of the codebase, I believe that these problems could be alleviated using synchronisation primitives offered by gevent (e.g. Synchronized queues, Locking primitives). For instance, some events such as start, stop, spawn events could be queued up and locking primitives could be used to ensure that only one of those mutually exclusive events (start and stop are two exclusive events IMO) is happening at a given time. Right now, these greenlets all run concurrently without real knowledge of each others resulting in flaky situations like the one in this issue. |
I wont have time to look at this, I think... Some else is welcome to try! |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself! |
Expected
Per suggestion in #831, I have a script that starts Locust through a POST request, then terminates Locust through a GET /stop.
There are two issues with this:
To repro
curl -XPOST -d "user_count=100&spawn_rate=10" http://$LOADGEN_IP/swarm
where user_count/spawn_rate are our custom fieldscurl http://$LOADGEN_IP/stop
STATUS: STOPPED
, and HTTPResponse is successful:Environment
The text was updated successfully, but these errors were encountered: