FAQ  •  Register  •  Login

Serviio Service will not Stop in a timely manner

<<

Morbius

Streaming enthusiast

Posts: 32

Joined: Thu Jan 12, 2017 3:10 am

Post Sun Jan 15, 2017 4:43 pm

Serviio Service will not Stop in a timely manner

This is apparently new to the last release?? Maybe two:

Do a mass rename on say 10 video files (or the associated poster/cover/etc.), Force Rescan of the Shares or Force Refresh of Metadata. (any or all of the above)

Attempt to rename one of the most recently renamed or added videos, associated graphic or containing folder. You get the the FILE IN USE message and cannot rename or move or delete. So, in the past, I would just stop the Serviio service (in Windows - not the Serviio Console) which releases all file locks and then make the remainder of my changes unimpaired by frustrating file locks. Finally, I Start the Serviio Service and go to shares and Force Refresh. Recently this has been unsuccessful.

The truly salient question is WHY DO YOU NEED TO OPEN THE FILES READ/WRITE and LOCK THE FILES to Refresh(Shares) or Rescan(Metadata) and update the library? In Windows, the normal FILE/OPEN API defaults to READ/WRITE and creates a File Handle LOCK but If you add the extra parameters, you may open them READ ONLY preventing a File Handle Lock and life would be much better!

So just recently. STOP the Serviio service. (alternatively, from a cmd prompt, Net Stop Serviio). The Serviio service progress bar gets to about halfway stopped very quickly and then crawls. Eventually, Services issues the message "The Serviio service did not stop in a timely manner" rather than finishing with the service in a clean stopped state. This leaves the Serviio service in an indeterminite state. The buttons for Start, Stop, etc. are grayed out and unavailable because Windows cannot determine the server state. The file locks remain and it leaves the DLNA server in a dicey state such that it may or may not respond to DLNA Clients (Service not available in KODI or it may only work for selected videos or it may continue to work, for example).

In an attempt to resolve the service state impasse, I have gone into Process Explorer (an advanced Task Manager replacement available from Microsoft) and attempted to restart the Serviio Serivce process threads (akin to taking a crowbar and a sledgehammer to a service) - well it just doesn't end well. The Serviio service apparently restarts after a message that the process may no longer work due to different credentials (I am the Administrator, not just a user with Administrative privilege). Windows Services continues to show the Serviio service in an indeterminite state (yes I did refresh). The DLNA Client can no longer access the Serviio DLNA Server which I expected due to the message during process restart. The only answer at this point is to RESTART WINDOWS. This is not the desirable behavior to say the least!!!!

Apparently, the only answer is to keep trying whatever you are trying to do until the file lock releases. This is frustrating in the extreme!!!!

AGAIN, If it is necessary to open the files READ/WRITE, WHY? What if I force the video files to be READ ONLY? What effect will this have on FILE LOCKS?

Perhaps an answer is to reset the credentials for Serviio Service to a USER which has only the PERMISSIONS "READ & EXECUTE", "LIST FOLDER CONTENTS" and "TRAVERSE FOLDER EXECUTE FILE" for the folder tree(s) containing the Videos? Such Draconian measures should prevent FILE LOCKS but this is not a simple solution for most users of Windows. Such Draconian measures may also prevent certain features of the DLNA Client from working or perhaps Serviio will not function properly at all.

I will presume that the processes that scan for file changes and metadata need software changes so that when the Serviio service is requested to be stopped, those processes/threads stop immediately irrespective of waits for Internet timeouts, perhaps set a progress checkpoint and permit the Serviio service to stop within the Windows timeout for services state change requests thereby stopping in a timely manner. When the service is restarted, those processes should resume from the checkpoint or maybe just restart altogether but with a large collection of videos, this could mean a lot of time getting back to the checkpoint. For +5K videos, Metadata RESCAN can literally take hours.

A request: Is there some way that you can indicate the progress for a REFRESH (Shares) or RESCAN (Metadata) in the Console or progress of those associated activies when Videos are added/deleted/renamed? Perhaps a simple option to post REFRESH START/STOP, RESCAN START/STOP, etc in a log file for diagnostic purposes?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jan 16, 2017 9:12 am

Re: Serviio Service will not Stop in a timely manner

I'm afraid the locks are down to the Java/OS implementation of the file watcher service. Serviio definitely only needs read access.

There was a ticket raised before: https://bitbucket.org/xnejp03/serviio/i ... close-file
Check the comments on that.
<<

Morbius

Streaming enthusiast

Posts: 32

Joined: Thu Jan 12, 2017 3:10 am

Post Tue Jan 17, 2017 1:33 am

Re: Serviio Service will not Stop in a timely manner

zip wrote:I'm afraid the locks are down to the Java/OS implementation of the file watcher service. Serviio definitely only needs read access.

There was a ticket raised before: https://bitbucket.org/xnejp03/serviio/i ... close-file
Check the comments on that.


Does shifting to the Pollier ... change the behaviour

I asked several questions and but the MOST IMPORTANT: HOW DO I SHUT DOWN THE SERVIIO SERVICE TIMELY????

HOW DO I SHUT DOWN THE JAVA FILE WATCHER SERVICE. There is no "named" service "sun..." or "java..."

Your referral to another thread seems to make no sense to ANY of my questions. Does anyone ACTUALLY READ the questions?

If I UNINSTALL JAVA, will SERVIIO continue to function?
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Jan 17, 2017 2:59 am

Re: Serviio Service will not Stop in a timely manner

Does shifting to the Pollier ... change the behaviour
I have never had the lock problem you describe so not sure - I will try your mass rename scenario when I get home. Try the poller method and let the forum know (it may do as it will not use the file watcher service - you may have to restart the service after setting polling on each share to ensure the filewatcher service doesn't start)
HOW DO I SHUT DOWN THE JAVA FILE WATCHER SERVICE. There is no "named" service "sun..." or "java..."
By using polling on all shares it shouldn't start.
If I UNINSTALL JAVA, will SERVIIO continue to function?
No. Serviio relies on Java.
MOST IMPORTANT: HOW DO I SHUT DOWN THE SERVIIO SERVICE TIMELY????
Try my WinHelper program. That uses the Serviio API to gracefully shut down the service rather than terminating the service.
Does anyone ACTUALLY READ the questions?
Yes, but when they are embedded in long posts they can get lost. Perhaps SHOUTING less may help ;)
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

BernardRat

Serviio newbie

Posts: 3

Joined: Mon Jan 04, 2021 5:42 pm

Post Mon Jan 04, 2021 5:51 pm

Re: Serviio Service will not Stop in a timely manner

serviio file lock.JPG
serviio file lock.JPG (50.41 KiB) Viewed 3713 times
Four years have passed and this is still a problem. I shouldn't have to stop the Serviio server to be able to delete a file!!!
<<

atc98092

User avatar

DLNA master

Posts: 5215

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Jan 04, 2021 9:16 pm

Re: Serviio Service will not Stop in a timely manner

BernardRat wrote:Four years have passed and this is still a problem. I shouldn't have to stop the Serviio server to be able to delete a file!!!

I only encounter that if the file has been recently added to my library, and Serviio is still indexing it and downloading the metadata. It's never held me up for more than a minute. I haven't had to stop the service to do that for years.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

BernardRat

Serviio newbie

Posts: 3

Joined: Mon Jan 04, 2021 5:42 pm

Post Mon Jan 04, 2021 11:21 pm

Re: Serviio Service will not Stop in a timely manner

Hi, thanks for the reply. Yes this is a problem when the file is new, I can't rename it or delete it. If I rename an old video file, make a mistake and try to rename it again it won't let me. BTW I have metadata turned off for video files. If I wait, it can be up to 30 minutes before it lets me delete or rename the file unless I stop the server first. I don't understand why the file is open for so long in the first place? Thanks for any advice.
<<

atc98092

User avatar

DLNA master

Posts: 5215

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Tue Jan 05, 2021 12:14 am

Re: Serviio Service will not Stop in a timely manner

I can't say why it's taking so long. What operating system are you using? I don't see that amount of lock time with Windows 10 and Serviio 2.1.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

BernardRat

Serviio newbie

Posts: 3

Joined: Mon Jan 04, 2021 5:42 pm

Post Tue Jan 05, 2021 5:43 pm

Re: Serviio Service will not Stop in a timely manner

I'm using 64 bit Win 10 Home, current version, Serviio 2.1. Everything is up to date. I probably have thousands of image, video and MP3 files on multiple disks and directories but that still does not explain why serviio keeps the file open for such a long long time? It shouldn't take more than a millisecond to open the file, determine what it is, close the file and then update the database. Thanks.
<<

atc98092

User avatar

DLNA master

Posts: 5215

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Wed Jan 06, 2021 1:46 am

Re: Serviio Service will not Stop in a timely manner

I can't explain why it's remaining open on your server for so long. As I said, I don't think I've seen one locked for over a minute. Zip has been away for a bit, but hopefully he can shed some light on what might be the cause.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 42 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.