UMS is not stopping

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
MetaRZA
Posts: 7
Joined: Tue Mar 07, 2023 8:43 am

More investigation

Post by MetaRZA »

So waiting until the next day, UMS shutdown takes a lot longer.

It turns out that LoggerFactory.getILoggerFactory().stop(); also closes stderr. So I reorganized net.pms.PMS.shutdown() to close logging last. I now see that most of the shutdown delay is in MediaDatabase.shutdown(). I also added Runtime.getRuntime().halt(0); This means UMS now exits with code 0, instead of 130.

I don't know if this is helpful.

I also see things like

Code: Select all

WARN  15:50:53.045 [Library Scanner] Unhandled exception while resolving DSCN6654: Task net.pms.util.APIUtils$$Lambda$258/0x0000000800f94770@66736c63 rejected from java.util.concurrent.ThreadPoolExecutor@54def6d2[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 7278]
WARN  15:51:00.539 [Library Scanner] Unhandled exception while resolving DSCN6663: Task net.pms.util.APIUtils$$Lambda$258/0x0000000800f94770@29b8633c rejected from java.util.concurrent.ThreadPoolExecutor@54def6d2[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 7278]
and

Code: Select all

INFO  15:57:59.517 [File watcher] Exception in thread "File watcher" java.nio.file.ClosedWatchServiceException
INFO  15:57:59.518 [File watcher]       at java.base/sun.nio.fs.AbstractWatchService.checkOpen(Unknown Source)
INFO  15:57:59.519 [File watcher]       at java.base/sun.nio.fs.AbstractWatchService.checkKey(Unknown Source)
INFO  15:57:59.519 [File watcher]       at java.base/sun.nio.fs.AbstractWatchService.take(Unknown Source)
INFO  15:57:59.519 [File watcher]       at net.pms.util.FileWatcher.lambda$start$0(FileWatcher.java:211)
INFO  15:57:59.519 [File watcher]       at java.base/java.lang.Thread.run(Unknown Source)
boss
Posts: 343
Joined: Thu Jun 30, 2016 1:07 pm

Re: UMS is not stopping

Post by boss »

Perhaps my startup and shutdown script may be of some help.
Attachments
ums.zip
(1.47 KiB) Downloaded 53 times
MetaRZA
Posts: 7
Joined: Tue Mar 07, 2023 8:43 am

Re: UMS is not stopping

Post by MetaRZA »

UMS is supposed to shutdown on SIGTERM or SIGINT without an issue. I hope to find out why it wasn't. I now suspect my DB was [edited].

What's more, your script is using SIGKILL, which is exactly what I was hoping to avoid.
Post Reply