On Tue, Apr 18, 2017 at 03:53:29PM +0300, Slawa Olhovchenkov wrote:
> now_ms posible wrap (by design).
> As result delta_ms calcultaed as `TICKS_TO_MS(tick_remain(now_ms,
> exp)) + 1` can be negative. This caused negative
> timeout.tv_sec/timeout.tv_nsec, failed kevent() (EINVAL) and infinite
> loop.

That's an interesting case that we've contemplated already a few weeks
ago and didn't see how to make it fail. The only case where it could
happen would be when there's a timeout larger than 24.3 days (2147483647
ms to be precise) in the configuration so that a task is scheduled further
in the future. But even with such an exact value in the config, the issue
would last a single millisecond, as on the next millisecond the difference
is reduced by one millisecond and doesn't overflow anymore.

We still need to keep it in mind as a corner case to reproduce the bug
though.

Willy

Reply via email to