qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r801290 - /qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp
Date Wed, 05 Aug 2009 16:37:47 GMT
Author: astitcher
Date: Wed Aug  5 16:37:47 2009
New Revision: 801290

URL: http://svn.apache.org/viewvc?rev=801290&view=rev
Log:
Improved Timer delay/overrun warnings

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp?rev=801290&r1=801289&r2=801290&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp Wed Aug  5 16:37:47 2009
@@ -99,12 +99,12 @@
             // warn on extreme lateness
             AbsTime start(AbsTime::now());
             Duration late(t->sortTime, start);
-            if (late > 500 * TIME_MSEC) {
-                QPID_LOG(warning, "Timer delayed by " << late / TIME_MSEC <<
"ms");
-            }
             {
             ScopedLock<Mutex> l(t->callbackLock);
             if (t->cancelled) {
+                if (late > 500 * TIME_MSEC) {
+                    QPID_LOG(debug, "cancelled Timer woken up late by " << late / TIME_MSEC
<< "ms");
+                }
                 continue;
             } else if(Duration(t->nextFireTime, start) >= 0) {
                 Monitor::ScopedUnlock u(monitor);
@@ -112,7 +112,9 @@
                 // Warn on callback overrun
                 AbsTime end(AbsTime::now());
                 Duration overrun(tasks.top()->nextFireTime, end);
-                if (overrun > 1 * TIME_MSEC) {
+                if (late > 1 * TIME_MSEC) {
+                    QPID_LOG(warning, "Timer woken up late by " << late / TIME_MSEC
<< "ms");
+                } else if (overrun > 1 * TIME_MSEC) {
                     QPID_LOG(warning,
                         "Timer callback overran by " << overrun / TIME_MSEC <<
"ms [taking "
                         << Duration(start, end) << "]");



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message