Module: check_mk
Branch: master
Commit: 6c1b337636939fe56bef397e929aaa85ecd41958
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6c1b337636939f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 2 11:58:09 2017 +0200
5358 FIX Event console status queries now handle the Limit header correctly
The event console status queries (e.g. used to show data in the GUI) were
ignoring the Limit header which caused the EC to process too many rows
in the response to status queries.
Change-Id: I2eb6ac6c62b8f240e3df053741bb654ade28393c
---
.werks/5358 | 12 ++++++++++++
bin/mkeventd | 5 +++++
2 files changed, 17 insertions(+)
diff --git a/.werks/5358 b/.werks/5358
new file mode 100644
index 0000000..dc2a26d
--- /dev/null
+++ b/.werks/5358
@@ -0,0 +1,12 @@
+Title: Event console status queries now handle the Limit header correctly
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1506938154
+Class: fix
+
+The event console status queries (e.g. used to show data in the GUI) were
+ignoring the Limit header which caused the EC to process too many rows
+in the response to status queries.
diff --git a/bin/mkeventd b/bin/mkeventd
index 565adac..c8dcd12 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -3300,7 +3300,11 @@ class StatusTable(object):
# TODO: Add support for ColumnHeaders like in livestatus?
yield query.requested_columns
+ num_rows = 0
for row in self._enumerate(query):
+ if query.limit is not None and num_rows >= query.limit:
+ break # The maximum number of rows has been reached
+
# Apply filters
# TODO: History filtering is done in history load code. Check for
improvements
if query.filters and query.table_name != "history":
@@ -3309,6 +3313,7 @@ class StatusTable(object):
continue
yield self._build_result_row(row, requested_column_indexes)
+ num_rows += 1
# Must return a enumerable type containing fully populated lists (rows) matching the