[asterisk-bugs] [Asterisk 0011972]: tls transport often causes asterisk to lock

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Mar 4 09:09:41 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11972 
====================================================================== 
Reported By:                pj
Assigned To:                jamesgolovich
====================================================================== 
Project:                    Asterisk
Issue ID:                   11972
Category:                   Channels/chan_sip/General
Reproducibility:            random
Severity:                   block
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 103313 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             02-11-2008 11:04 CST
Last Modified:              03-04-2008 09:09 CST
====================================================================== 
Summary:                    tls transport often causes asterisk to lock
Description: 
when asterisk is locked, no call or registration is processed,
this happened several times today and yesterday (tried several trunk
revisions)
currently haven't found thing, what causes the locking situation, 
it seems, that locking problem start appearing, after more peers start
using tls transport
my tls only peers are: asterisk trunk, asterisk beta2 and eyebeam
sofphone
+several udp clients.



====================================================================== 

---------------------------------------------------------------------- 
 russell - 03-04-08 09:09  
---------------------------------------------------------------------- 
I just uploaded a patch.  Give it a try and see if it improves the
situation.

The patch changes the socket mutex to a rwlock, instead.  For a TCP/TLS
socket, we know there will only be one thread reading from the socket at a
time.  But, we have to be careful to ensure that only one thread will write
to it at a time.  That's what the lock was for.

By using a rwlock, the socket read thread will only use a read lock. 
Then, other threads writing to it will use a write-lock.  Then, a thread
trying to send something won't be blocked by the socket reading thread
while it's sleeping waiting for data to arrive on the socket.

That's what I think the problem was from the debug output I've looked
through on here ... 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-04-08 09:09  russell        Note Added: 0083313                          
======================================================================




More information about the asterisk-bugs mailing list