From: Sage Weil Date: Thu, 28 Jul 2011 16:39:15 +0000 (-0700) Subject: ceph_context: check internal heartbeat in cct service thread X-Git-Tag: v0.33~115 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7265e5cc20e58957d35009f1cbf5f34d662307f0;p=ceph.git ceph_context: check internal heartbeat in cct service thread Signed-off-by: Sage Weil --- diff --git a/src/Makefile.am b/src/Makefile.am index e1f47c1eaf99..3688f66c5e73 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,7 +17,7 @@ check_PROGRAMS = TESTS = $(check_PROGRAMS) -EXTRALIBS = +EXTRALIBS = -lrt if WITH_PROFILER EXTRALIBS += -lprofiler endif diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 8083792cedb7..4b3b0685c434 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -12,6 +12,8 @@ * */ +#include + #include "common/admin_socket.h" #include "common/DoutStreambuf.h" #include "common/perf_counters.h" @@ -44,7 +46,11 @@ public: void *entry() { while (1) { - sem_wait(&_sem); + struct timespec timeout; + clock_gettime(CLOCK_REALTIME, &timeout); + timeout.tv_sec += _cct->_conf->heartbeat_interval; + + sem_timedwait(&_sem, &timeout); if (_exit_thread) { break; } @@ -52,6 +58,7 @@ public: _cct->_doss->reopen_logs(_cct->_conf); _reopen_logs = false; } + _cct->_heartbeat_map->check_touch_file(); } return NULL; }