[authkey] auto user/group synchro increase number of threads

Dear Geoserver community

We encountered a problem with this feature : https://github.com/geoserver/geoserver/pull/7316 and I can’t post directly here : Jira - JIRA

If auto synchro is enabled, one thread is created every minute and stays in this state :
TIMED_WAITING (parking)

Here is a full example of a thread dump :

“pool-96-thread-1” #223 prio=5 os_prio=0 cpu=3.32ms elapsed=26671.98s tid=0x00007f982c60d800 nid=0x110a4 waiting on condition [0x00007f97d6fb2000]
java.lang.Thread.State: TIMED_WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@11.0.29/Native Method)

  • parking to wait for <0x00000004f41731c0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.parkNanos(java.base@11.0.29/LockSupport.java:234)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(java.base@11.0.29/AbstractQueuedSynchronizer.java:2123)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(java.base@11.0.29/ScheduledThreadPoolExecutor.java:1182)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(java.base@11.0.29/ScheduledThreadPoolExecutor.java:899)
    at java.util.concurrent.ThreadPoolExecutor.getTask(java.base@11.0.29/ThreadPoolExecutor.java:1054)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.29/ThreadPoolExecutor.java:1114)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.29/ThreadPoolExecutor.java:628)
    at java.lang.Thread.run(java.base@11.0.29/Thread.java:829)

This increase the number of threads continuously and finally it ends with a crash.

The solution is to disable the mapper auto sync.

Have I post my problem in the right place (I’m sorry if not) ? Have I to create an issue ?

Kind regards

Lionel