[sr-dev] git:master: modules_k/presence: Fixed bug - calling child_init in process main

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 12 16:02:25 CET 2012


Hello,

On 3/8/12 4:49 PM, Anca Vamanu wrote:
> Module: sip-router
> Branch: master
> Commit: 7f54aacb740011abe968eb599509cf296e003a61
> URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7f54aacb740011abe968eb599509cf296e003a61
>
> Author: Anca Vamanu<anca.vamanu at 1and1.ro>
> Committer: Anca Vamanu<anca.vamanu at 1and1.ro>
> Date:   Thu Mar  8 17:26:06 2012 +0200
>
> modules_k/presence: Fixed bug - calling child_init in process main
>
> 	Process main calls child_init with process type PROC_MAIN before
> 	forking the TCP children. Since presence module opens database
> 	connection in child_init, this resulted in connection being
> 	inherited by the TCP children and wierd things happening when doing
> 	DB operations.
Have you noticed db connection sharing between processes?

The DB API stores for each connection the PID of the process opening it. 
When a process is asking for a db connection and URL matches and 
existing one, current PID is checked with connection pid and if they 
differ, a new connection should be created, thus no connection sharing 
should be between processes. Is the db connection open in main process 
used in other processes?

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/




More information about the sr-dev mailing list