[OpenSIPS-Devel] [ opensips-Patches-2123971 ] Presence: suppress caching of receive socket

SourceForge.net noreply at sourceforge.net
Wed Oct 29 15:39:28 CET 2008


Patches item #2123971, was opened at 2008-09-23 08:50
Message generated for change (Comment added) made by anca_vamanu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2123971&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: modules
Group: trunk
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Kobi Eshun (ekobi)
Assigned to: Anca Vamanu (anca_vamanu)
Summary: Presence: suppress caching of receive socket 

Initial Comment:
Hi. Attached please find a patch for the Presence module to suppress saving the receive socket info with subscriber records. In a load-balanced, DB backed configuration, the receive socket is not likely to be valid for all pool members.

The patch adds a configuration parameter, disable_socket_cache, which defaults to 0. The admin documentation is also updated. Cheers,
--
kobi

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

>Comment By: Anca Vamanu (anca_vamanu)
Date: 2008-10-29 16:39

Message:
Hi Kobi,

While looking at your patch, we saw that the socketinfo was processed very
inefficient: stored as a string and parsed and searched for each time a
Notify was sent. So, we decided for another optimization. I have just
commited a patch in which a pointer is kept for the socket info structure
and the string is parsed only when fetching the dialog info from database.
In the case that you mentioned with load balancing with more presence
servers, if a server fetches a dialog entry that was inserted by another
server( and where the sockstr value is no longer valid), the search
function that looks for the socket will not find the corresponding bind
address and set the field to null. 

regards,
Anca Vamanu

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

Comment By: Kobi Eshun (ekobi)
Date: 2008-10-23 22:16

Message:
Hi, Anca.

You're right -- it is reasonable to characterize this as an optimization
rather than a bug fix. Cheers,
--
kobi

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

Comment By: Anca Vamanu (anca_vamanu)
Date: 2008-10-22 14:55

Message:
Hi Ekobi,

We took a look at the code there and it seems that it should work even if
you use more presence servers behind a load balancer. In case the stored
socket address is not valid, when Notify is sent for another machine than
the machine where Subscribe was received, when searching for the socket
with grep_sock_info the result will be NULL. 

notify.c line 1124:
	td->send_sock = grep_sock_info (&host, (unsigned short) port, (unsigned
short) proto);

So, the question is whether you have noticed something wrong in the
behavior of the server and this patch is a bug fix or is it an just
optimization that you discovered by analizing the code?

regards,
Anca Vamanu

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

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



More information about the Devel mailing list