Module: check_mk
Branch: master
Commit: d7cdd6e0b6b041332f36bc52790673d81a8fedb5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d7cdd6e0b6b041…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Oct 23 16:39:46 2018 +0200
6507 FIX Fixed 100% CPU usage of the CMC after writing to its command pipe
After writing to its command pipe tmp/run/nagios.cmd, the CMC's CPU usage
went up to 100%. This has been fixed.
Change-Id: I2f6b9330d348a3f5c0467303cd5a89d906e53860
---
.werks/6507 | 11 +++++++++++
livestatus/src/Poller.h | 5 +++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/6507 b/.werks/6507
new file mode 100644
index 0000000..56925e9
--- /dev/null
+++ b/.werks/6507
@@ -0,0 +1,11 @@
+Title: Fixed 100% CPU usage of the CMC after writing to its command pipe
+Level: 2
+Component: core
+Compatible: compat
+Edition: cee
+Version: 1.6.0i1
+Date: 1540305466
+Class: fix
+
+After writing to its command pipe tmp/run/nagios.cmd, the CMC's CPU usage
+went up to 100%. This has been fixed.
diff --git a/livestatus/src/Poller.h b/livestatus/src/Poller.h
index abebfe3..296113f 100644
--- a/livestatus/src/Poller.h
+++ b/livestatus/src/Poller.h
@@ -34,7 +34,7 @@
#include <vector>
#include "BitMask.h"
-enum class PollEvents { in = 1 << 0, out = 1 << 1 };
+enum class PollEvents { in = 1 << 0, out = 1 << 1, hup = 1 << 2 };
IS_BIT_MASK(PollEvents);
class Poller {
@@ -78,7 +78,8 @@ private:
// guaranteed short value range.
return static_cast<short>(
(is_empty_bit_mask(e & PollEvents::in) ? 0 : POLLIN) |
- (is_empty_bit_mask(e & PollEvents::out) ? 0 : POLLOUT));
+ (is_empty_bit_mask(e & PollEvents::out) ? 0 : POLLOUT) |
+ (is_empty_bit_mask(e & PollEvents::hup) ? 0 : POLLHUP));
}
};