locust4j icon indicating copy to clipboard operation
locust4j copied to clipboard

Exceptions when running with the newest locust (2.25.0)

Open zettelmj opened this issue 1 year ago • 6 comments

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

zettelmj avatar Apr 16 '24 19:04 zettelmj

How can I reproduce this issue?

myzhan avatar Apr 17 '24 02:04 myzhan

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

zettelmj avatar Apr 17 '24 03:04 zettelmj

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

zettelmj avatar Apr 17 '24 06:04 zettelmj

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

myzhan avatar Apr 17 '24 13:04 myzhan

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

zettelmj avatar Apr 17 '24 14:04 zettelmj

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

myzhan avatar Apr 18 '24 02:04 myzhan