Module: check_mk
Branch: master
Commit: 028dcf0e3f58ce0eb540a5f2b5c54f4ce0da170b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=028dcf0e3f58ce…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 5 13:21:35 2019 +0100
7228 FIX Fixed failing liveproxyd activation when process is currently starting
There was a race condition in the code that made configuration changes fail
with a message like "Could not reload Livestatus Proxy: invalid literal for
int() with base 10: \'\'. See web.log for further information." when one
tried to chang the site configuration while the proxy was currently in a
specific part of the process startup phase.
Change-Id: I88de20d46895643bf8b811493ccfc4f9af97eabd
---
.werks/7228 | 14 ++++++++++++++
cmk/gui/watolib/config_domains.py | 8 +++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/7228 b/.werks/7228
new file mode 100644
index 0000000..803770d
--- /dev/null
+++ b/.werks/7228
@@ -0,0 +1,14 @@
+Title: Fixed failing liveproxyd activation when process is currently starting
+Level: 1
+Component: liveproxy
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1551788397
+Class: fix
+
+There was a race condition in the code that made configuration changes fail
+with a message like "Could not reload Livestatus Proxy: invalid literal for
+int() with base 10: \'\'. See web.log for further information." when one
+tried to chang the site configuration while the proxy was currently in a
+specific part of the process startup phase.
diff --git a/cmk/gui/watolib/config_domains.py b/cmk/gui/watolib/config_domains.py
index 8f2db16..fb4195e 100644
--- a/cmk/gui/watolib/config_domains.py
+++ b/cmk/gui/watolib/config_domains.py
@@ -39,7 +39,6 @@ import cmk.gui.config as config
import cmk.gui.mkeventd as mkeventd
from cmk.gui.log import logger
from cmk.gui.i18n import _
-from cmk.gui.globals import html
from cmk.gui.exceptions import MKGeneralException
from cmk.gui.watolib.changes import log_audit
@@ -127,6 +126,13 @@ class ConfigDomainLiveproxy(ConfigDomain):
pass
else:
raise
+ except ValueError:
+ # ignore empty pid file (may happen during locking in
+ # cmk.utils.daemon.lock_with_pid_file(). We are in the
+ # situation where the livstatus proxy is in early phase of the
+ # startup. The configuration is loaded later -> no reload needed
+ pass
+
except Exception as e:
logger.exception()
raise MKGeneralException(