From d493b6bf62b0d14db55cd84b7fcc583e59fd1a9f Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Tue, 24 May 2016 15:24:50 +0800 Subject: [PATCH] Event: remove clock skew detect since we use mono clock now Signed-off-by: Haomai Wang --- src/msg/async/Event.cc | 13 +------------ src/msg/async/Event.h | 2 -- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/msg/async/Event.cc b/src/msg/async/Event.cc index ff535c7b81965..8d973a2fcf0c5 100644 --- a/src/msg/async/Event.cc +++ b/src/msg/async/Event.cc @@ -275,20 +275,9 @@ int EventCenter::process_time_events() ldout(cct, 10) << __func__ << " cur time is " << now << dendl; Mutex::Locker l(time_lock); - /* If the system clock is moved to the future, and then set back to the - * right value, time events may be delayed in a random way. Often this - * means that scheduled operations will not be performed soon enough. - * - * Here we try to detect system clock skews, and force all the time - * events to be processed ASAP when this happens: the idea is that - * processing events earlier is less dangerous than delaying them - * indefinitely, and practice suggests it is. */ - bool clock_skewed = now < last_time; - last_time = now; - while (!time_events.empty()) { auto it = time_events.begin(); - if (now >= it->first || clock_skewed) { + if (now >= it->first) { TimeEvent &e = it->second; EventCallbackRef cb = e.time_cb; uint64_t id = e.id; diff --git a/src/msg/async/Event.h b/src/msg/async/Event.h index 14c3ab429cce2..7a72179dfa1d6 100644 --- a/src/msg/async/Event.h +++ b/src/msg/async/Event.h @@ -111,7 +111,6 @@ class EventCenter { EventDriver *driver; multimap time_events; uint64_t time_event_next_id; - clock_type::time_point last_time; // last time process time event clock_type::time_point next_time; // next wake up time int notify_receive_fd; int notify_send_fd; @@ -138,7 +137,6 @@ class EventCenter { notify_receive_fd(-1), notify_send_fd(-1), net(c), owner(0), notify_handler(NULL), already_wakeup(0) { - last_time = clock_type::now(); } ~EventCenter(); ostream& _event_prefix(std::ostream *_dout); -- 2.39.5