[Freeswitch-users] mod_event_zmq thread safety

Alex Massover alex at jajah.com
Thu Aug 16 23:50:48 MSD 2012


Hi,

This is what I understood as well. I'm not able to get a core for some reason, but provided that event callback is called by different threads, it strongly suggests that current implementation of mod_event_zmq is unsafe as sharing zmq context is not thread-safe.

What is the process of creating a ticket, please? Should I sing-up to JIRA?

--
Alex.
________________________________________
From: freeswitch-users-bounces at lists.freeswitch.org [freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of João Mesquita [jmesquita at freeswitch.org]
Sent: Thursday, August 16, 2012 10:27 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] mod_event_zmq thread safety

I do *think* that events are dispatched by different workers on the core indeed which might be the cause of your problem. ZMQ also has a few asserts on the core that can be quite disruptive and they were working on getting it working more properly. Dunno what's the status of that right now.

A core dump would help a lot on any case tho.

João Mesquita



On Thu, Aug 16, 2012 at 4:23 PM, Alex Massover <alex at jajah.com<mailto:alex at jajah.com>> wrote:
Hello,

We're using mod_event_zmq module (slightly modified, we use different socket type and IPC instead of TCP), and experience crashes.

As far as I understood the module it creates ZMQ context and all event sent by using same context.

Events callback is called from different threads, isn't it? And can be a situation when different threads access send() api on this context simultaneously.

ZMQ guide strongly prohibits doing that: " You MUST NOT share ØMQ sockets between threads."

And when I do a mutex around send() there're no more crashes (at least today).

Am I missing something or mod_event_zmq is potentially dangerous?

--
Best Regards,
Alex Massover
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list