Stop locusts graceful
See original GitHub issueProposal
Add possibility to stop locusts without killing them (via Greenlet.kill
). Currently executed tasks should continue, but no new tasks should be scheduled.
Motivation My load test is a bit uncommon, since I’m using some prepopulation and an additional utility database (redis), which data should be consistent with application data. So my locustfile contains something like this:
def task():
result = self.client.post('smth').json() # (1)
self.redis.set('key', result['value']) # (2)
When I press [Stop] button, a few on-the-fly tasks are interrupted between (1) and (2). Unfortunately this means that data between application and redis become inconsistent and I’m no longer able to restart test. It forces me to start my prepopulation script again and waste a lot of time.
If locust tasks were stopped graceful, allowing them to return, there would be no problem.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top GitHub Comments
I’m trying to add this feature in https://github.com/locustio/locust/pull/1099 . I just need to fix my bugs first 😃
@xppt Did #1099 solve your issue?