org.mycore.pi.urn.rest.MCRURNGranularRESTRegistrationStarter prevents proper shutdown of application server

Description

If you include property MCR.Startup.Class=%MCR.Startup.Class%,org.mycore.pi.urn.rest.MCRURNGranularRESTRegistrationStarter in your mycore.properties file you cannot properly shutdown your application server.

First guess is the missing shutdown of the org.mycore.pi.MCRPIService#REGISTER_POOL executor service.

See the following stacktrace during shutdown of tomcat:
10-Apr-2019 09:59:35.155 SEVERE [localhost-startStop-2] se.jiderhamn.classloader.leak.prevention.JULLogger.error Internal registry of java.beans.PropertyEditorManager not found
10-Apr-2019 09:59:35.162 INFO [localhost-startStop-2] se.jiderhamn.classloader.leak.prevention.JULLogger.info Thread 'Thread[pool-5-thread-1,5,main]' with contextClassLoader = protected ClassLoader or child is a ThreadPoolExecutor.Worker of java.util.concurrent.ScheduledThreadPoolExecutor but found no reason to shut down ThreadPoolExecutor.
10-Apr-2019 09:59:35.163 WARNING [localhost-startStop-2] se.jiderhamn.classloader.leak.prevention.JULLogger.warn Thread 'Thread[pool-5-thread-1,5,main]' with contextClassLoader = protected ClassLoader or child; waiting 5000 ms. Thread stack trace:
at java.base@11.0.2/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@11.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
at java.base@11.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
at java.base@11.0.2/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
at java.base@11.0.2/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
at java.base@11.0.2/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
at java.base@11.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
at java.base@11.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.2/java.lang.Thread.run(Thread.java:834)
10-Apr-2019 09:59:40.166 WARNING [localhost-startStop-2] se.jiderhamn.classloader.leak.prevention.JULLogger.warn Thread 'Thread[pool-5-thread-1,5,main]' with contextClassLoader = protected ClassLoader or child still alive; changing context ClassLoader to leak safe (jdk.internal.loader.ClassLoaders$AppClassLoader@799f7e29). Thread stack trace:
at java.base@11.0.2/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@11.0.2/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
at java.base@11.0.2/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
at java.base@11.0.2/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
at java.base@11.0.2/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
at java.base@11.0.2/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
at java.base@11.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
at java.base@11.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.2/java.lang.Thread.run(Thread.java:834)

Environment

None

Assignee

Sebastian Hofmann

Reporter

Silvio Hermann

Labels

None

URL

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Medium
Configure