Module: check_mk
Branch: master
Commit: bd8b6a64542aebc5e078bb85409cdf03e55c7409
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bd8b6a64542aeb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Aug 16 13:21:22 2011 +0200
Livestatus: better handling of "No timeperiod information"
---
livestatus/src/TimeperiodsCache.cc | 10 +++++++---
livestatus/src/module.c | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/livestatus/src/TimeperiodsCache.cc b/livestatus/src/TimeperiodsCache.cc
index ed94aba..96007ec 100644
--- a/livestatus/src/TimeperiodsCache.cc
+++ b/livestatus/src/TimeperiodsCache.cc
@@ -89,9 +89,13 @@ bool TimeperiodsCache::inTimeperiod(timeperiod *tp)
if (it != _cache.end())
is_in = it->second;
else {
- logger(LG_INFO, "No timeperiod information available for %s.",
tp->name);
- time_t now = time(0);
- is_in = 0 == check_time_against_period(now, tp);
+ logger(LG_INFO, "No timeperiod information available for %s. Assuming out of
period.", tp->name);
+ is_in = false;
+ // Problem: The method check_time_against_period is to a high
+ // degree not thread safe. In the current situation Icinga is
+ // very probable to hang up forever.
+ // time_t now = time(0);
+ // is_in = 0 == check_time_against_period(now, tp);
}
pthread_mutex_unlock(&_cache_lock);
return is_in;
diff --git a/livestatus/src/module.c b/livestatus/src/module.c
index c5b1bbb..d740369 100644
--- a/livestatus/src/module.c
+++ b/livestatus/src/module.c
@@ -193,6 +193,7 @@ void *client_thread(void *data __attribute__ ((__unused__)))
void start_threads()
{
+ logger(LG_INFO, "Going to open socket and starting threads");
if (!g_thread_running) {
/* start thread that listens on socket */
pthread_atfork(livestatus_count_fork, NULL, livestatus_cleanup_after_fork);