[OpenSIPS-Devel] [opensips] "time_keeper" process slowly lags behind (#745)

Liviu Chircu notifications at github.com
Wed Jan 6 10:07:41 CET 2016


The sole purpose of the *"time_keeper"* process is to loop infinitely while counting seconds and microseconds. Doing anything else besides that was avoided because it would cause his time keeping duties to gradually offset, thus losing track of time.

But simply looping (not to mention also incrementing a few integers) is a job itself, and that takes time! This causes the *"time_keeper"* to occasionally lose some (micro)second increments, although it is designed to be work-free!

This bug affects scheduled operations in OpenSIPS. The further away in the future they are, the bigger the gap between when they **should run**, and when they're **actually run**, some time later.

The concerned time keeping routine is `run_timer_process_jif()`. Solution should involve occasionally synchronizing with the system. We cannot use CPU time since there's some I/O going on (notice the `select()` syscall for `ITIMER_TICK` μs), so `gettimeofday()` along with a defensive mechanism should suffice (protection against sudden system time changes).

Reported by Grygoriy Dobrovolskyy

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/745
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160106/384adb85/attachment.htm>


More information about the Devel mailing list