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@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev