myzhan / locust4j

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

Exceptions when running with the newest locust (2.25.0) #43

Open zettelmj opened 3 months ago

zettelmj commented 3 months ago

Hi,

I am using the newest version of locust4j with the newest version of locust (2.25.0). I am seeing a large number of exceptions like:

java.lang.IllegalArgumentException: null
  at java.base/java.util.concurrent.ThreadPoolExecutor.setMaximumPoolSize(Unknown Source)
  at com.github.myzhan.locust4j.runtime.Runner.startSpawning(Runner.java:217)
  at com.github.myzhan.locust4j.runtime.Runner.onSpawnMessage(Runner.java:291)
  at com.github.myzhan.locust4j.runtime.Runner.onMessage(Runner.java:336)
  at com.github.myzhan.locust4j.runtime.Runner.access$600(Runner.java:28)
  at com.github.myzhan.locust4j.runtime.Runner$Receiver.run(Runner.java:413)
  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
  at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.base/java.lang.Thread.run(Unknown Source)

any ideas what could cause this/Hints how to debug the Issue?

Thank you Jens

myzhan commented 3 months ago

How can I reproduce this issue?

zettelmj commented 3 months ago

It seems to happen most frequently when a run is stopped. I will comb more thorough the logs later

zettelmj commented 3 months ago

I went through the logs. To give particular example: I can see the worker coming online. Master node then logs out that the worker is available. Approximately 3 microseconds after spawning jobs (1 user at 1.0 spawn rate) the above stack trace can be observed (and is repeated every seconds till the job is stopped).

I forgot to mention that the Task itself is written in Kotlin (Version 1.9.22) and is running on temurin 21 latest

myzhan commented 3 months ago

I can't reproduce while spawning jobs(1 user at 1.0 spawn rate) using OpenJDK.

zettelmj commented 3 months ago

Is there a specific class I could set logging to tracing on or something similar that would allow a bit more insights?

myzhan commented 3 months ago

You can try to print out the messages sent by locust here, https://github.com/myzhan/locust4j/blob/24d6c68e1baf9e10dfe4864beee7a03ef73b6229/src/main/java/com/github/myzhan/locust4j/runtime/Runner.java#L295