Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Scheduled Job behavior after Alteryx Service is Stopped and Started

igallion
6 - Meteoroid

Hello,

 

I have set up two scheduled powershell scripts that stop the alteryxservice every week to allow backups to be done during a one hour window. First, the Alteryx Service is stopped using 'stop-service'. If the service remains in the 'stopping' state for over 10 minutes, the second script runs and the alteryxservice process is stopped forcefully using 'stop-process -force'.

 

My question is, what is the behavior of scheduled jobs where either a.) The service stops gracefully using stop-service and b.) The service is forcefully stopped using stop-service -force. Any help is appreciated, thank you!

2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hey @igallion,

 

If you have schedules running, you won`t be able to stop the service without a force stop. So if you can stop the service gracefully, that means you didn`t have any jobs running at the time.

https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/Alteryx-Service-Stuck-in-Stopping-Sta...

 

Regarding the jobs themselves, I`m unsure if the unfinished job will restart or be disregarded. I will test and share the results with you.

 

 

Best regards,

Fernando Vizcaino

Cordeimd17
Alteryx
Alteryx

@igallion Thank you so much for reaching out! Happy to provide some information in regard to this:


If the AlteryxService is instructed to stop (via the service or command line), and there are active jobs running, it will wait until the jobs are done running or they hit the job runtime threshold as defined in Alteryx System Settings before the service is stopped. This is related to the graceful stops of services or command line.

The graceful stop will wait until the job are completed before the service goes “down.”

So, if the service is not stopping after 10 minutes of attempting to stop it via command line or services as mentioned, it's most likely because there are jobs that are actively running within the environment. 

In a forceful stop, it can't be guaranteed that those jobs will complete. These runs of workflows may stop in its tracks and could potentially leave a partial write to excel files. 

Given your scenario, I have some suggestions:

  1.    If possible, wait until the service gracefully stops before downtime of the service by adjusting the PowerShell script.
  2.    Run scheduled downtime/maintenance during off peak usage hours where schedules are not running. If schedules are running ever 15 minutes for 24 hours, this may require altering schedules to not run for a period of time, whether it be Sundays, a 2 hour period at night, or any other combination of planned load management
  3.    Instruct teams to adjust schedules as possible to allow for a window of time where you will not have to forcefully shut down the service because of the point that in a situation where it is force stopped, it cannot be guaranteed that these jobs will be complete. This does also apply to the functionality of writes to an excel output.


Thank you!