myzhan / locust4j

Locust4j is a load generator for locust, written in Java.
MIT License
81 stars 30 forks source link

Exception with locust 2.2.1 #35

Closed dininski closed 2 years ago

dininski commented 2 years ago

When running with the latest version of locust (2.2.1) the following exception occurs:

15:24:07.087 TKD [Thread-3receive-from-client] ERROR c.g.myzhan.locust4j.runtime.Runner - Error while receiving a message
java.io.IOException: Message received unsupported type: ARRAY
    at com.github.myzhan.locust4j.message.Message.unpackMap(Message.java:88)
    at com.github.myzhan.locust4j.message.Message.unpackMap(Message.java:85)
    at com.github.myzhan.locust4j.message.Message.<init>(Message.java:38)
    at com.github.myzhan.locust4j.rpc.ZeromqClient.recv(ZeromqClient.java:42)
    at com.github.myzhan.locust4j.runtime.Runner$Receiver.run(Runner.java:387)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

From a little bit of debugging it appears that there is a user_classes message being passed of type ARRAY

myzhan commented 2 years ago

I see, since 2.2.0, locust sends parsed_options to workers. I'm working on a new bugfix version of locust4j.

see also: https://github.com/locustio/locust/issues/1877

cyberw commented 2 years ago

Does locust4j have to match the exact layout of the message? I try to be careful in removing/changing the payload in a way that would require changes in worker implementations, but I didnt know you'd have issues with new parameters.

stephen-harris commented 2 years ago

@myzhan Just created a PR (had fixed it before I'd seen your message about working on a fix, so feel free to disregard).

@cyberw The issue was less additional data in the message, and more to do with the type of data (array) that hadn't previously been supported.

myzhan commented 2 years ago

@stephen-harris Thanks for your effort, I will review your MR.

myzhan commented 2 years ago

FYI, I have released locust4j 2.2.0 to address this issue.