Cancel currently running action // mod: prioritize, manage, pause server tasks

Feature suggestion: Cancel currently running action.
Sometimes I need to stop the currently running action for some reason. For example, I recently had to turn off my NAS to relocate it, but I had intro detection running at the time, and also someone streaming something (stored elsewhere). I would’ve liked to simply click a single “cancel action” button that would stop the intro detection from running, so that I could safely turn off my NAS without upsetting my server. Instead, I had to interrupt my friend’s movie session, and completely shut down my Plex server. Just a little button in the spinning progress circle to cancel the currently running action would be great!

Edit: Cancel ALL actions in the queue, not just the current action being performed.

Just shut down the server.
No need to micro-manage and stop each action it currently does separately.

I should’ve specified, it’s doesn’t just cancel the current action, but any further actions in the queue. I can cancel a scan with no issue, why not this? Shutting down the entire server disrupts users if they’re using it at the time, and I’m sure many like to upset their users as little as possible, lest the users immediately decide they hate Plex because it’s problematic once.

Plex will shut down anyway if you shutdown your NAS. Whether you stop any processes before or not doesn’t change that.

My Plex server is running on my Windows PC, not the NAS. My NAS is just network storage.
Regardless, the example was just one of many possible use cases.

I would complement this with a “roll-back last” and “pause” all server tasks. I’ve had situations where I’m moving a video file, something fails during transfer and I don’t notice in time, then Plex will start creating thumbnails with an incomplete file.

1 Like

I think including the “NAS shutdown” element is derailing this whole idea.
Let’s just focus on an ‘X’ button on running Plex tasks so we can stop them - specifically - on e.g. the dashboard.
I agree with the MOD saying it makes no sense if you shut down the NAS anyway…

This is based off of another thread I saw recently. I wanted to expand upon the original idea to flesh it out more. Currently when Plex is doing non-streaming operations the only real way to tell what is using system resources is using some form of task manager in your OS of choice. It will show you what Plex itself is consuming, but it won't show you why (obviously).

 

As a server administrator I would like the ability to login to Plex Web and somewhere under settings, or even a link only I can see on the main web app page, there's a screen to see currently running tasks. Ideally it would spit out the task name, like Generating Indexes (%movieName% - %estToFinish%) or Scanning Metadata %percentComplete% etc. along with a progress bar. A button/toggle to either pause or cancel the job would also be nice. There are plenty of tasks that Plex does and having a way to see what is going on in real-time with the ability to intervene for those with lighter hardware would be awesome. 

 

Use cases

  • I run Plex on my desktop at the moment as I'm saving for a full time box. Plex often interferes with resources. The ability to stop certain things without killing plex would be nice.
  • A bunch of people are streaming late and you forgot to turn off scheduled tasks. Go pause the system hogs until your movie is done.
  • You're adding a movie but don't want Plex to process everything so you pause the metadata/generate index process until you've watched it.

 

TL;DR Create an executing tasks screen for plex so you can see exactly what is being executed.

I propose adding a new view to the activity screen called ‘Queue

What is it for?
The queue would display the list of tasks currently outstanding or queued but not started ordered by FIFO. This primarily concerns media scanner jobs but could also include scheduled or explicit tasks for thumbnailing, analysis, optimise, clean and emptying trash.

What would it include?
It would include the time added, a identifer/name and a estimated time to start (estimate if queued, exact if scheduled)

Why do this for tasks?
I’ll focus on scanning for this as it is a good example of something where one explicit action can initiate a large number of tasks which can take a long time to execute. The queue is about exposing the amount of work left to do to the UI.

When adding a large amount of media, or forcing a refresh of a media, plex first establishes the list of files to process afaik. As they are processed the output/progress is added to the logs and available to view in the activity > alerts screen. By having the scanners add the tasks they run to the queue, it would enable visibility over the amount of work remaining and the possibility through estimation* to establish the time left to complete.

This could also include a breakdown of the metadata agent queries per scanner.

What else could it be useful for?
Well aside from being able to view the estimated time and workload on the plex media server, it could be useful for providing pause and resume functionality to the server and media scanners.

If persisted to disk, it could also be used for faster startup/resumes by loading exsiting queues

Any queue stats like no of tasks remaining or time estimates could be used elsewhere in the UI to indicate the server is working.

In the event of scanners stalling, crashing or otherwise apparent inactivity it could be useful for diagnostics and troubleshooting in addition to the logs and crash data.

If metadata agents are individually queued, it could also help troubleshoot config issues or non-responsive/misbehaving agents

  • estimation would likely require recording and persistence of task execution timing data.

Disclaimer: I don’t know anything about how plex works internally so apologies if what I’ve suggested is not within the architectural scope of the server/plugin components

Queue view

Many people don’t enable video preview thumbnails right away because they don’t have the space, initially have a slow processor, or for other reasons. So when they do decide to enable them, they have built up a very large library and the process will take weeks or longer before “…and when new media is added” becomes a viable option for them.

During this time their CPU will be at 100% load generating these thumbnails, and they may need to stop that temporarily to do other things on that machine. The current workaround, short of stopping the server completely, is to manipulate the scheduled tasks start and end times:

This is far from ideal, especially when a Cancel Scan option appears after initiating Scan Library. That’s all we need, a Cancel Analyze option that appears after the user has initiated Analyze.

I would like to be able to pause an activity so another one can run first. Or maybe be able to move them up and down a list. For example, I created a new library, and then set a couple of Scan Library Files. It’s many hours later, and because the new library needs to be set up, detecting intros and credits must be done, this may run for many hours more. Meanwhile changes to the other already existing libraries are still in the cue, though they would only take seconds. I know this is my fault, I should have done things in a different order. Still, it would be great if I change the order of activities.

Simply disable them prior to scanning large new libraries.
Settings - Server - Library