Skip to content
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

Fix Typo on Occurrences #25

Merged
merged 1 commit into from
Oct 22, 2021
Merged

Fix Typo on Occurrences #25

merged 1 commit into from
Oct 22, 2021

Conversation

jeffhall-wk
Copy link
Contributor

@jeffhall-wk jeffhall-wk commented Oct 22, 2021

Hello!

I was recently running into the following error when my java cron would try to record a failure, and it would completely drop my worker from locust master.

$ /ERROR/stderr: Traceback (most recent call last):
$ /ERROR/stderr:
$ /ERROR/stderr: File "src/gevent/greenlet.py", line 854, in gevent._greenlet.Greenlet.run
$ /ERROR/stderr:
$ /ERROR/stderr: File "/Users/jeffhall/.virtualenvs/virtenv/lib/python3.6/site-packages/locust/runners.py", line 465, in client_listener
    events.slave_report.fire(client_id=msg.node_id, data=msg.data)
$ /ERROR/stderr:
$ /ERROR/stderr: File "/Users/jeffhall/.virtualenvs/virtenv/lib/python3.6/site-packages/locust/events.py", line 34, in fire
    handler(**kwargs)
$ /ERROR/stderr:
$ /ERROR/stderr: File "/Users/jeffhall/.virtualenvs/virtenv/lib/python3.6/site-packages/locust/stats.py", line 674, in on_slave_report
    global_stats.errors[error_key] = StatsError.from_dict(error)
$ /ERROR/stderr:
$ /ERROR/stderr: File "/Users/jeffhall/.virtualenvs/virtenv/lib/python3.6/site-packages/locust/stats.py", line 627, in from_dict
    data["occurrences"]
$ /ERROR/stderr:
$ /ERROR/stderr: KeyError: 'occurrences'
$ /ERROR/stderr:
$ /ERROR/stderr: 2021-10-21T15:52:47Z
$ /ERROR/stderr:
$ /ERROR/stderr: <Greenlet at 0x10990b648: <bound method MasterLocustRunner.client_listener of <locust.runners.MasterLocustRunner object at 0x109983438>>> failed with KeyError

I then found this comment about a typo https://github.com/anhldbk/swarm/blob/master/src/main/java/com/bigsonata/swarm/common/stats/StatsError.java#L30 and noticed that looks like the typo has been fixed... at least in locust 0.14.6 which is what I'm running and it looks like its been fixed since 0.12.0! (See: locustio/locust#1024 & locustio/locust@f0a5f89 )

I forked and fixed up the word on the Swarm side and it seemed to help me get around my error! Figured I could offer this fix here too!

@anhldbk
Copy link
Owner

anhldbk commented Oct 22, 2021

@jeffhall-wk Change looks great. Thank you!

@anhldbk anhldbk merged commit 17aeb2b into anhldbk:master Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants