Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: e3e3b97e33cf6c3a7cc8e65e2a9023e60ab20e0c
https://github.com/Checkmk/checkmk/commit/e3e3b97e33cf6c3a7cc8e65e2a9023e60…
Author: Lars Michelsen <lm(a)checkmk.com>
Date: 2024-07-10 (Wed, 10 Jul 2024)
Changed paths:
A .werks/16563.md
M bin/.f12
A bin/cmk-wait-for-background-jobs
M cmk/gui/background_job/__init__.py
M cmk/gui/background_job/_base.py
M cmk/gui/background_job/_manager.py
A cmk/gui/background_job/_wait.py
M cmk/gui/gui_background_job.py
A omd/packages/check_mk/skel/etc/init.d/background-jobs
A omd/packages/check_mk/skel/etc/rc.d/60-background-jobs
M tests/pylint/checker_cmk_module_layers.py
M tests/unit/cmk/gui/test_background_job.py
Log Message:
-----------
16563 FIX Ensure background jobs finish properly on stopping sites
Previously running background jobs were not properly cleaned up by `omd stop`.
Those processes were terminated at the end of `omd stop` command which would
clean up the processes in most cases, but lead to failed jobs and leave crash
reports behind.
Secondly a few background jobs depend on Redis. In case Redis is stopped while
the jobs are still running, the jobs would fail and also leave a crash report
behind.
This change aims to solve both issues, by extending what happens during
`omd stop`. The procedure roughly works like this:
1. First the apache process and site cron are stopped to prevent the
start of new background jobs. This is done by the already existing logic.
2. The new init script `background-jobs` gives the jobs some time to finish.
Ideally all jobs are stopped after 20 seconds.
3. The stop command does not have to forcefully kill the jobs anymore in this case.
4. As a last resort `omd stop` will terminate the still running jobs as before.
Change-Id: I2e54c35478beff06ab831aabb278d60b8f2b879c
To unsubscribe from these emails, change your notification settings at
https://github.com/Checkmk/checkmk/settings/notifications