]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Event: remove clock skew detect since we use mono clock now
authorHaomai Wang <haomai@xsky.com>
Tue, 24 May 2016 07:24:50 +0000 (15:24 +0800)
committerHaomai Wang <haomai@xsky.com>
Wed, 29 Jun 2016 04:14:04 +0000 (12:14 +0800)
Signed-off-by: Haomai Wang <haomai@xsky.com>
src/msg/async/Event.cc
src/msg/async/Event.h

index ff535c7b8196524f528cf50e31f6e5e7aef31803..8d973a2fcf0c5f18767b084ab4e7cee8f395c6d3 100644 (file)
@@ -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;
index 14c3ab429cce2f479e539942898c20ebbf2a6f50..7a72179dfa1d6023e3069f18458be72057f35853 100644 (file)
@@ -111,7 +111,6 @@ class EventCenter {
   EventDriver *driver;
   multimap<clock_type::time_point, TimeEvent> 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);