error in startup schedule disabling fixed
@@ -1128,13 +1128,17 @@ class Scheduler(object):
except:
pass
del self._schedule_executions[schedule_id]
+ try:
# As of now, script starts the process and therefore, we need to explicitly stop this script process
# as shutdown caters to stopping of the actual service only.
task_process.process.terminate()
+ except ProcessLookupError:
+ pass # Process has terminated
else: # else it is a Task e.g. North tasks
# TODO: FOGL-356 track the last time TERM was sent to each task
task_process.cancel_requested = time.time()
# Terminate process
+ try:
try:
# We need to terminate the child processes because now all tasks are started vide a script and
# this creates two unix processes. Scheduler can store pid of the parent shell script process only
@@ -1142,6 +1146,8 @@ class Scheduler(object):
# be stopped.
utils.terminate_child_processes(task_process.process.pid)
task_process.process.terminate()
+ except ProcessLookupError:
+ pass # Process has terminated
task_future = task_process.future
if task_future.cancel() is True:
await self._wait_for_task_completion(task_process)
