]> granicus.if.org Git - icinga2/commitdiff
Fix negative 'empty in' value in WorkQueue log message 6430/head
authorMichael Insel <michael@insel.email>
Tue, 10 Jul 2018 17:12:12 +0000 (19:12 +0200)
committerMichael Insel <michael@insel.email>
Tue, 10 Jul 2018 17:21:04 +0000 (19:21 +0200)
This fixes a negative 'empty in' value in WorkQueue log messages.

lib/base/workqueue.cpp

index ae3dad9b053a7ef16ef5812c1cabd93c16dbbfef..7e8ad589046c711662f01cecca3d49184dcbdc3d 100644 (file)
@@ -24,6 +24,7 @@
 #include "base/application.hpp"
 #include "base/exception.hpp"
 #include <boost/thread/tss.hpp>
+#include <math.h>
 
 using namespace icinga;
 
@@ -221,7 +222,7 @@ void WorkQueue::StatusTimerHandler()
 
        if (pending > GetTaskCount(5)) {
                timeInfo = " empty in ";
-               if (timeToZero < 0)
+               if (timeToZero < 0 || std::isinf(timeToZero))
                        timeInfo += "infinite time, your task handler isn't able to keep up";
                else
                        timeInfo += Utility::FormatDuration(timeToZero);