Module: check_mk
Branch: master
Commit: 298902e146958d744767f63160bac2b727820f9e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=298902e146958d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Dec 5 13:24:22 2017 +0100
add WK 5250
Change-Id: I2e65abddca7d1aa4451e70ef68baadad8727d607
---
.werks/5250 | 13 +++++++++++++
web/htdocs/htmllib.py | 5 +++++
web/htdocs/watolib.py | 7 +++++++
3 files changed, 25 insertions(+)
diff --git a/.werks/5250 b/.werks/5250
new file mode 100644
index 0000000..dd54eb0
--- /dev/null
+++ b/.werks/5250
@@ -0,0 +1,13 @@
+Title: Fixed tmpfs full issue: Activate Changes did not cleanup all temporary files
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i2
+Date: 1512476335
+
+The WATO work directory <tt>~/tmp/check_mk/wato</tt> could grow in size,
+whenever an unexpected exception happened during the activate changes process.
+
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index f5f3cb1..65bcfdb 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1655,6 +1655,11 @@ class html(HTMLGenerator, RequestHandler):
raise NotImplementedError()
+ def get_request_timeout(self):
+ return self._request_timeout
+
+
+
#
# Messages
#
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 0ae5eba..44ad842 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -4901,6 +4901,13 @@ class ActivateChangesManager(ActivateChanges):
for site_id in self._sites:
site_state = state["sites"][site_id]
+
+ # The site_state file may be missing/empty, if the operation has started
recently.
+ # However, if the file is still missing after a considerable amount
+ # of time, we consider this site activation as dead
+ if site_state == {} and time.time() - self._time_started >
html.get_request_timeout() - 10:
+ continue
+
if site_state == {} or site_state["_phase"] == PHASE_INITIALIZED:
# Just been initialized. Treat as running as it has not been
# started and could not lock the site stat file yet.