Hi,
the mediaproxy-module in 3.3 branch establishes a single shared connection to the mediaproxy dispatcher socket before sip-router is forking sub-processes. This leads to race-conditions when multiple calls to use_mediaproxy() are made in parallel. The fix is simple, it seems it was just forgotten to restrict the opening of the dispatcher connection to subprocess initialization. Patch attached.
Regards,
Emil Kroymann
Emil Kroymann writes:
the mediaproxy-module in 3.3 branch establishes a single shared connection to the mediaproxy dispatcher socket before sip-router is forking sub-processes. This leads to race-conditions when multiple calls to use_mediaproxy() are made in parallel. The fix is simple, it seems it was just forgotten to restrict the opening of the dispatcher connection to subprocess initialization. Patch attached.
emil,
i just applied your patch to master although i don't understand it. after patch, less connections are opened to dispatcher. why are you saying that before there was only one?
-- juha
hm, don't know, what is happening for you? I thought, the child_init function is called at least once with rank <= 0 before the fork and then after the fork in every child process with rank > 0. And if the connection is already openend before the fork, it is not openend again in the child process. So in theory, the patch should have the effect, that one connection is openend in every child process. I tested this and for me it works like this with the patch applied, and only one connection is openend if the patch is not applied.
Regards, Emil
Am Thu, 13 Dec 2012 14:02:58 +0200 schrieb Juha Heinanen jh@tutpro.com:
Emil Kroymann writes:
the mediaproxy-module in 3.3 branch establishes a single shared connection to the mediaproxy dispatcher socket before sip-router is forking sub-processes. This leads to race-conditions when multiple calls to use_mediaproxy() are made in parallel. The fix is simple, it seems it was just forgotten to restrict the opening of the dispatcher connection to subprocess initialization. Patch attached.
emil,
i just applied your patch to master although i don't understand it. after patch, less connections are opened to dispatcher. why are you saying that before there was only one?
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Emil Kroymann writes:
hm, don't know, what is happening for you? I thought, the child_init function is called at least once with rank <= 0 before the fork and then after the fork in every child process with rank > 0. And if the connection is already openend before the fork, it is not openend again in the child process.
ok, i tested it and your patch worked as you explained. i'll cherry pick the commit to 3.3.
-- juha
emil,
just for curiosity, have you used mediaproxy module's ice capability? i guess it is currently the only possibility to include ice support in kamailio.
-- juha
Hi Juha,
no, we don't use ice, just plain nat traversal with nathelper module.
Regards, Emil
Am Sat, 15 Dec 2012 17:39:34 +0200 schrieb Juha Heinanen jh@tutpro.com:
emil,
just for curiosity, have you used mediaproxy module's ice capability? i guess it is currently the only possibility to include ice support in kamailio.
-- juha