فهرست منبع

ZOOKEEPER-642. "exceeded deadline by N ms" floods logs (Marc Celani via michim)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1337029 13f79535-47bb-0310-9956-ffa450edef68
Michi Mutsuzaki 13 سال پیش
والد
کامیت
25cb38f42e
2فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 2 0
      CHANGES.txt
  2. 3 1
      src/c/src/zookeeper.c

+ 2 - 0
CHANGES.txt

@@ -181,6 +181,8 @@ BUGFIXES:
   ZOOKEEPER-1318. In Python binding, get_children (and get and exists, and probably others)
   ZOOKEEPER-1318. In Python binding, get_children (and get and exists, and probably others)
   with expired session doesn't raise exception properly (henryr via michim)
   with expired session doesn't raise exception properly (henryr via michim)
 
 
+  ZOOKEEPER-642. "exceeded deadline by N ms" floods logs (Marc Celani via michim)
+
 IMPROVEMENTS:
 IMPROVEMENTS:
 
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 3 - 1
src/c/src/zookeeper.c

@@ -1555,7 +1555,9 @@ int zookeeper_interest(zhandle_t *zh, int *fd, int *interest,
     gettimeofday(&now, 0);
     gettimeofday(&now, 0);
     if(zh->next_deadline.tv_sec!=0 || zh->next_deadline.tv_usec!=0){
     if(zh->next_deadline.tv_sec!=0 || zh->next_deadline.tv_usec!=0){
         int time_left = calculate_interval(&zh->next_deadline, &now);
         int time_left = calculate_interval(&zh->next_deadline, &now);
-        if (time_left > 10)
+        int max_exceed = zh->recv_timeout / 10 > 200 ? 200 : 
+                         (zh->recv_timeout / 10);
+        if (time_left > max_exceed)
             LOG_WARN(("Exceeded deadline by %dms", time_left));
             LOG_WARN(("Exceeded deadline by %dms", time_left));
     }
     }
     api_prolog(zh);
     api_prolog(zh);