curl IP/stop does not actually terminate Locust swarms
See original GitHub issueExpected 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:
- Depending on the spawn_rate, calling GET /stop only terminates httpusers that are already spawned. I expected this would terminate the entire test’s users.
- If you initiate a swarm with a HTTP request, the UI doesn’t have a “STOP” button. The only way to terminate that swarm is with a GET /stop.
To repro
curl -XPOST -d "user_count=100&spawn_rate=10" http://$LOADGEN_IP/swarm
where user_count/spawn_rate are our custom fields- sleep for 5 seconds, then
curl http://$LOADGEN_IP/stop
- Notice, after running step 2 UI indicates
STATUS: STOPPED
, and HTTPResponse is successful:
{
"message": "Test stopped",
"success": true
}
- However, according to our reliable telemetry, Locust is still swarming
Environment
- Locust version: 1.3.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How can we control locust swarms? | World Economic Forum
Currently, the most commonly used control is insecticide. Sprayed from land or aerial vehicles, whole swarms can be targeted in relatively ...
Read more >Untitled
Download for free video converter, Are you ready lyrics skepta, Birdlife malta telephone, ... Nordheim court apartments, Hg abort repository not found, ...
Read more >Stop Locust When Specified Number Of User Tasks Complete
Supplying raise StopLocust() will tell the current user (Locust) to stop and no longer pick tasks once it reaches the end of that...
Read more >Celebrity painting #1 - The best painting collection ... - OpenSea
No offers yet ... sticks dynamite easier than fishing pole catch fish took while everything decided change actually choosing fox tophat whispered ear...
Read more >Untitled
Bof 4544a, Way brothers fanfiction, Am still not over you, Evan liollio, ... Jutta meyfarth, Fatal dog attacks by breed 2013, Is the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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!