[sr-dev] question on RPC script reload: how is it invoked in the workers?

Daniel-Constantin Mierla miconda at gmail.com
Tue Feb 20 16:35:01 CET 2018


Hello,

the script reload mechanism relies on a counter (version number) stored
in shared memory. It is set to 0 when kamailio start and increased with
each RPC reload command.

Each worker process has a copy of the value in a local variable.

When a worker process is executing a script, it checks if the local
value matches the one from shared memory. If different, then it should
reload the script before executing it.

This is how is done for Lua, JavaScript and Squirrel. I tried to
implement the same for app_python, but I couldn't make it work properly
due to lack of (embedding) python experience.

Cheers,
Daniel


On 20.02.18 15:58, Anthony Alba wrote:
> Hi list,
>
> I am looking at the python script reload functionality exposed by the
> rpc command "app_python.reload" and implemented by the function
> app_python_rpc_reload.
>
> The implementation increments a version number and calls
> apy_reload_script(). But it looks like apy_reload_script() would be
> run invoked in the process where the RPC server lives rather than the
> children.
>
> How is it sent to the workers for invocation?
>
> I think I am misunderstanding how the RPC server works: how do you
> differentiate between RPC functions meant to be executed by the master
> vs sent to all the slaves?
>
>
> Thanks
> Anthony
>
> _______________________________________________
> Kamailio (SER) - Development Mailing List
> sr-dev at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com




More information about the sr-dev mailing list