[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 12:49:59 CET 2009


Bugs item #2684950, was opened at 2009-03-12 13:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: None
Priority: 5
Private: No
Submitted By: Vasil Kolev (krokodilerian)
Assigned to: Nobody/Anonymous (nobody)
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.


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

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