Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

curl IP/stop does not actually terminate Locust swarms

See original GitHub issue

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:

  1. 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.
  2. 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

  1. curl -XPOST -d "user_count=100&spawn_rate=10" http://$LOADGEN_IP/swarm where user_count/spawn_rate are our custom fields
  2. sleep for 5 seconds, then curl http://$LOADGEN_IP/stop
  3. Notice, after running step 2 UI indicates STATUS: STOPPED, and HTTPResponse is successful:
  "message": "Test stopped",
  "success": true
  1. However, according to our reliable telemetry, Locust is still swarming


  • Locust version: 1.3.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

mboutetcommented, Jan 21, 2021

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.

github-actions[bot]commented, May 25, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >
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 >
Bof 4544a, Way brothers fanfiction, Am still not over you, Evan liollio, ... Jutta meyfarth, Fatal dog attacks by breed 2013, Is the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found