[OpenSIPS-Devel] [ opensips-Patches-3042432 ] [pua] add a "publish" queue to avoid deadlock

Alex Hermann alex at speakup.nl
Mon Aug 16 14:38:27 CEST 2010


On Monday 16 August 2010, Alex Hermann wrote:
> On Tuesday 10 August 2010, SourceForge.net wrote:
> > I will commit my implementation. It is different from the one posted by
> > Christophe as I have taken out the second lock completely.
> > Unfortunately I still noticed some issues with it and I was not able to
> > fix them until now. I am leaving in vacation until Monday and this is why
> > I am putting it out now, as a proof of concept. I still need to fix a
> > bug I saw in my test, and I will do that next week.
> 
> I have tesetd the new implementation and have a few comments

Some more issues:

Failure handling in callback. After an error "return" isn't appropriate if 
another publish is waiting to be sent.

Also in the callback, handling is a bit inefficient: update_htable is called, 
and directly after exactly the same logic as in the beginning of that function 
is done again (locking the hash and finding the entry). I think it is cleaner 
to take the lock once and keep it as long as necessary.

In construct_pending_publ, extra_headers is taken from presentity. It should 
instead come from the stored publ_t (note that the extra_headers aren't copied 
either from the original publ_info_t). This bug causes a segfault.

Why isn't the publ_info_t supplied to send_publish stored in its entirety? Now 
a function build_pending_publ is called and later on construct_pending_publ to 
handle it again. Can't these be combined to store (a copy of) the original 
publ_info_t?


I'm willing to help coding a clean and working pua implementation, if 
interested in working together, please contact me.
-- 
Greetings,

Alex Hermann




More information about the Devel mailing list