Module: check_mk
Branch: master
Commit: d4c878f51e686acf2f3068ec22222f214c4b19de
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d4c878f51e686a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Feb 26 15:51:41 2019 +0100
Fixed missing lock release if a timeout occurs while loading data from a file
Change-Id: Ibc86a999978cf85d324fd71600da10b4067f888d
---
.werks/7103 | 13 +++++++++++++
cmk/utils/store.py | 3 +++
2 files changed, 16 insertions(+)
diff --git a/.werks/7103 b/.werks/7103
new file mode 100644
index 0000000..f85203d
--- /dev/null
+++ b/.werks/7103
@@ -0,0 +1,13 @@
+Title: Fixed possibly permanent PENDING or STALE services
+Level: 1
+Component: config
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1551192479
+Class: fix
+
+This was caused by a missing lock release if a timeout occurs
+while loading data from a file.
+For example loading or saving files which contain counter
+values for calculating rate or average values.
diff --git a/cmk/utils/store.py b/cmk/utils/store.py
index 62d96ba..0b71ecd 100644
--- a/cmk/utils/store.py
+++ b/cmk/utils/store.py
@@ -149,7 +149,10 @@ def load_data_from_file(path, default=None, lock=False):
return default
except MKTimeout:
+ if lock:
+ release_lock(path)
raise
+
except Exception as e:
if lock:
release_lock(path)