[OpenSIPS-Devel] [OpenSIPS/opensips] b6d281: Fix potential starvation for the timer tasks.

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Sep 14 17:50:16 CEST 2016


  Branch: refs/heads/2.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: b6d281932547684d1ed44bc797106a7aa937fde1
      https://github.com/OpenSIPS/opensips/commit/b6d281932547684d1ed44bc797106a7aa937fde1
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M main.c
    M pt.c
    M timer.c
    M timer.h

  Log Message:
  -----------
  Fix potential starvation for the timer tasks.

Even if the timer tasks have priority in the asyns reactor (for being handled), if all the worker processes are already busy in handling some SIP tasks which takes too long, may lead into a starvation of the timer tasks.
For the moment we address this by creating a extra worker processes (similar to the SIP workers) which is dedicated to executing the timer tasks. Still, based on their availability and load, the SIP workers are able to consume timer tasks.

In the next steps, this issue will be better addressed by implementing the concepts of "preferred jobs" and "capacity reservation" for the processes in the pool.

Credits for helping with the investigation and testing go to Ramachandran, Agalya

(cherry picked from commit c40f2b057209b8078520abc95e5d1bf5e5a28db6)




More information about the Devel mailing list