Keycloak Benchmark Tool - Forcefully stopping the task

Hi There,

I am using keycloak benchmark tool (GitHub - keycloak/keycloak-benchmark) to create realms for performance testing. After creating around 1400 realms, the server was not responding. I checked the status of the running tasks by calling API “/realms/master/dataset/status” and got the below response.

{“status”:“Task in progress”,“task-id”:“Creation of 5 realms from realm-1437 to realm-1441, started: Wed Jun 08 17:59:55 GMT 2022”}

I restarted my docker container and called the above API again but still got the same response. I have below questions.

  1. How can I forcefully stop the running task? Why is it not stopped even after I restarted my container? I checked the keycloak benchmark source code and it seems it’s storing the running tasks in the “work” cache. Does it not mean the cache is local to the running container and it should be cleared if the container is restarted?

  2. Is there any way to clear the “work” cache by ssh into docker container?

Thanks,
Sagun