Bug report: downtimes beyond 2038 cause event queue errors

Ton Voon ton.voon at opsview.com
Wed Apr 10 12:53:39 CEST 2013

On 9 Apr 2013, at 19:35, Andreas Ericsson wrote:

> On 04/08/2013 02:12 PM, Ton Voon wrote:
>> RHEL5 32 bit:
>> long = 4
>> time_t = 4
>> tv = 8
>> pqueue_pri_t = 8
>> RHEL5 64 bit:
>> long = 8
>> time_t = 8
>> tv = 16
>> pqueue_pri_t = 8
> Ah. Obviously. We're truncating 16 bytes down to 8 for priority,
> checking, but retain the 16 bytes to check if it's time to actually
> run the event yet, so we hang in the event execution loop when
> we come across such events.
> I've committed a fix which will allow events to be scheduled
> until year 141166 for 64-bit systems (43 bits). It's not
> possible to extend the time for 32-bit systems, so if you think
> you managed to schedule things beyond year 2038, you were wrong.
> That last point is sort of important though. It's still possible
> to schedule things that appear to be far into the future that
> actually run straight away. We can't do anything about that, because
> in lib/squeue we can't differ between "far in the past" or "far into
> the future", since the value is already wrapped when we get it there.

It appears that in Nagios 3, if you schedule a downtime to end in the year 2113 on a 32 bit system, it is silently ignored and no downtime is marked. I think that's reasonable - someone will just schedule again with better values. This happens on a 32 bit system in Nagios 4 too.

If you schedule downtime on a 64 bit system in 2113 on Nagios 3, then it is accepted.

So what happened was that some downtime was set in 2113 in Nagios 3, and then when Nagios 4 read the accepted value in retention.dat, it triggered this event queue error.

I guess you could get strange values if you transitioned from a 64 bit system to a 32 bit system, but that would be unlikely.

> We will not, however, stop running events anymore.

I've just tried to recreate the error and your fix allows the event queue to continue, so I can confirm this is fine now.


Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!

More information about the Developers mailing list