[sr-dev] [kamailio/kamailio] kazoo: improper ampq consumer worker procs (#972)

Ovidiu Sas notifications at github.com
Tue Feb 7 16:39:02 CET 2017


During init, the kazoo module performs forking for "AMQP Consumer Worker".
The ranks for all this process are incremented one by one, starting with value 1.
Value 1 is defined as PROC_SIPINIT and has a special meaning for most of the regular modules.
One side effect of this is that the registration records are loaded from the db twice!
One simple fix would be to fork all the workers with a PROC_NOCHLDINIT ranking.

Proposed patch:
````
--- a/src/modules/kazoo/kazoo.c
+++ b/src/modules/kazoo/kazoo.c
@@ -369,7 +369,7 @@ static int mod_child_init(int rank)
                */

                for(i=0; i < dbk_consumer_workers; i++) {
-                       pid=fork_process(i+1, "AMQP Consumer Worker", 1);
+                       pid=fork_process(PROC_NOCHLDINIT, "AMQP Consumer Worker", 1);
                        if (pid<0)
                                return -1; /* error */
                        if(pid==0){
````

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/972
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170207/dfe71ee9/attachment-0001.html>


More information about the sr-dev mailing list