List Info

Thread: OPAL SIP deadlock on incoming calls




OPAL SIP deadlock on incoming calls
user name
2006-11-04 14:21:26
On 2. Nov 2006, at 17:54, Simon Zwahlen wrote:

> Hi,
>
> I've just been looking at a similar deadlock situation
with H.323.  
> The problem here is that in
H323Connection::HandleSignalPDU the  
> connection is locked read/write, and
OpalCall::OnEstablished  
> requires read/write lock on the OpalCall. In another
thread, the  
> OpalCall::OnConnected is called, OpalCall is locked
readonly  
> (currently read/write, doesn't make a difference), and
requires a  
> readonly lock of the connections.
>
> Somebody got an idea how to fix this? Rewriting the PDU
handling is  
> quite complex. Would it be an option to make a copy of
the member  
> connectionsActive, and give up the read lock of
OpalCall while  
> processing the connections?
>
>
> On Thu, 02 Nov 2006 22:12:55 +1100, Robert Jongbloed  
> <robert.jongbloedbigpond.com> wrote:
> (snipped)
>> Actually, looking at this code, I have no idea why
it is a ReadWrite
>> lock at all. A ReadOnly lock would be adequate as
it only reads the
>> lists.
>
> I agree, but it should be over the whole method
(accessing  
> connectionsActive should be read protected).
>
>> I have been thinking about a much more conservative
locking  
>> arrangement.
>> A single read/write mutex for the OpalCall and all
attached
>> OpalConnections. This is a bit tricky to implement,
but will fix the
>> A2B/B2A deadlock issue once and for all at the
expense of a very  
>> slight
>> performance hit.
>
> That would really be the most easy way to fix such
issues, I agree  
> with that too 

Me too... As I'm developing an end-user application,
performance  
issues aren't my concern. But if someone uses OPAL for a
server-like  
application, it might make a difference.

For the SIP part, it could be easily fixed by locking the
OpalCall  
before locking the SIPConnection, without having to rewrite
much code  
- at least not for the moment

>
> Simon
>
>
------------------------------------------------------------
---------- 
> --
> Check the FAQ before asking! - http://www.openh32
3.org/~openh323/ 
> fom.cgi
> The OpenH323 Project mailing list, using Mailman. To
unsubscribe or
> change your subscription options, goto
> htt
p://www.openh323.org/mailman/listinfo/openh323
> Maintained by Quicknet Technologies, Inc - http://www.quicknet.net
>
------------------------------------------------------------
---------- 
> --

------------------------------------------------------------
------------
Check the FAQ before asking! - http://www.
openh323.org/~openh323/fom.cgi
The OpenH323 Project mailing list, using Mailman. To
unsubscribe or
change your subscription options, goto
htt
p://www.openh323.org/mailman/listinfo/openh323
Maintained by Quicknet Technologies, Inc - http://www.quicknet.net
------------------------------------------------------------
------------
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )