Merge branch 'fix-scheduler-shutdown' into 'master'

Fix scheduler shutdown

See merge request !3517

(cherry picked from commit 9f14dc93)

ac72ea95 Fix scheduler shutdown
9 jobs for !3520 with cherry-pick-9f14dc93 in 17 minutes (queued for 2 seconds)
merge request