[OpenSIPS-Devel] [ opensips-Bugs-2684950 ] Bug with timers and using get_ticks from a timer thread

SourceForge.net noreply at sourceforge.net
Thu Mar 12 13:01:06 CET 2009


Bugs item #2684950, was opened at 2009-03-12 13:49
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2684950&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: trunk
Status: Open
>Resolution: Accepted
>Priority: 9
Private: No
Submitted By: Vasil Kolev (krokodilerian)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Bug with timers and using get_ticks from a timer thread

Initial Comment:
There's a nasty issue with the timer code and for example tcp-related functions...

My case was that the timer thread was processing expired registrations and sending notifies for those. Turns out that for some of the registrations which were over TLS the connection was dropped and OpenSIPS tried to establish a new connection to the user, by calling tcpconn_connect_blocking(). That function relies on get_ticks() (e.g. jiffies) to see when it's timed out, but because those ticks are increased in the same thread that called it, it in fact had to wait the default system timeout for connect() (which is about 4 minutes, instead of the 10 seconds OpenSIPS is configured with).

The fix is a bit invasive, but seems like the right way to do it - the jiffies increase is moved in a separate thread and everyone uses that.


----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-03-12 14:01

Message:
Hi Vasil,

Thanks for the report - indeed, the safest fix will be to move the jiffies
into a separate proc to avoid timer blocking and also to increase the timer
accuracy.

Let me review the patch.

Regards,
Bogdan 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2684950&group_id=232389



More information about the Devel mailing list